Working with Cursors

  • I need to write some tests scripts to test a stored procedure in Oracle that returns a reference cursor to the user.

    create or replace procedure my_oracleProc (

    results_cursor OUT sys_refcursor ,

    p_remote_user IN VARCHAR2 ,

    p_remote_address IN VARCHAR2 )

    ...

    The Oracle documentation sucks, and doesn't help me figure out how to write a script to call my procedure and then test the return values of the results_cursor.

    Any help would be greatly welcomed.

  • Okay, figured out a way to test the stored procedure and check the result set returned in the sys_refcursor without writing any sql code. Used the TEST feature in PS/SQL Developer. You are able to inspect the values in the cursor by selecting the ellipses next to that parameter.

  • Gotta love it when you have to answer your own question 🙂

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • John Rowan (11/12/2010)


    Gotta love it when you have to answer your own question 🙂

    Yep, unfortunately it doesn't solve the overall problem, which is being able to write scripts to test code programmatically. Would still like to know how to do that using Oracle, but as I said, the Oracle documentation sucks.

  • Wish I could help, I haven't touched (or thought about) Oracle in 6 years....but back when I worked in Oracle, I used the metalink site for support...learned alot there.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Did you figure this out?

    If not here is a link that should get you going: http://www.oracle-base.com/articles/misc/UsingRefCursorsToReturnRecordsets.php

    You gotta love Oracle... 😉

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply