how to view a Oracle stored procedure result set in sql developer?

  • Hi,

    Sorry coming from the SQL world something as easy as highlighting the sp name and viewing the results in management studio is very difficult for me to find in SQL developer. I have the below sproc created in Oracle db, now i want to execute it and view the results to test the sproc. How do you do this?

    I tried using the "run" option when i right click the sp name in SQL developer and when i highlight the pl/sql block chunk of code after passing in a correct input parameter i get s "pls-00306:wrong number or types of arguments in call to '||'.

    Appreciate the help.

    CREATE OR REPLACE

    PROCEDURE GET_UNPROCESSED_SETREQ (vInstance IN pmcs_setreq_out.instance%type,retval out sys_refcursor )AS

    BEGIN

    open retval for

    select

    pmcs_seq, instance, mach_key, reel_key, set_num, reel_lm, set_lm, set_offset, diam, pmcs_pos_one_side, flipped, pmcs_action,

    ct_rolls, grade, trim_key_xref,pat_xref parent_pos,

    pmcs_setreq_values_00, pmcs_setreq_values_01, pmcs_setreq_values_02, pmcs_setreq_values_03, pmcs_setreq_values_04,

    pmcs_setreq_values_05, pmcs_setreq_values_06, pmcs_setreq_values_07, pmcs_setreq_values_08, pmcs_setreq_values_09,

    pmcs_setreq_values_10, pmcs_setreq_values_11, pmcs_setreq_values_12, pmcs_setreq_values_13, pmcs_setreq_values_14,

    pmcs_setreq_values_15, pmcs_setreq_values_16, pmcs_setreq_values_17, pmcs_setreq_values_18, pmcs_setreq_values_19,

    pmcs_setreq_values_20, pmcs_setreq_values_21, pmcs_setreq_values_22, pmcs_setreq_values_23, pmcs_setreq_values_24,

    pmcs_setreq_values_25, pmcs_setreq_values_26, pmcs_setreq_values_27, pmcs_setreq_values_28, pmcs_setreq_values_29

    from pmcs_setreq_out where pmcs_processed = 0 and instance = vInstance order by pmcs_seq;

    EXCEPTION

    WHEN no_data_found THEN

    NULL;

    END GET_UNPROCESSED_SETREQ;

  • Do you have a recent version of sql developer? [/url]. Have to research it myself

  • I got it. Here is the new sproc i created to test with. Below the sproc i have pasted the PL/SQL block of code that is saved when you right click and "Run" the sproc. When you click ok after you modify the PL/SQL block window with the code below you click "OK" and it will display the records. You will have to create the table and columns and populate the rows sorry i didn't have time to create that script. Wow so much work just to execute a sproc makes you appreciate management studio. =)

    CREATE OR REPLACE

    PROCEDURE test_GET_UNPROCESSED_SETREQ2 (vInstance IN pmcs_setreq_out.instance%type,retval out sys_refcursor )AS

    BEGIN

    open retval for

    select pmcs_seq,instance

    from pmcs_setreq_out where pmcs_processed = 0 and instance = vInstance order by pmcs_seq;

    EXCEPTION

    WHEN no_data_found THEN

    NULL;

    END test_GET_UNPROCESSED_SETREQ2;

    --------------------------

    DECLARE

    VINSTANCE CHAR(1);

    RETVAL sys_refcursor;

    v_a number;

    v_b char(1);

    BEGIN

    VINSTANCE := 'b';

    TEST_GET_UNPROCESSED_SETREQ2(

    VINSTANCE => VINSTANCE,

    RETVAL => RETVAL

    );

    -- Modify the code to output the variable

    -- DBMS_OUTPUT.PUT_LINE('RETVAL = ' || RETVAL);

    LOOP

    FETCH RETVAL INTO v_a, v_b;

    EXIT WHEN RETVAL%NOTFOUND;

    dbms_output.put_line(v_a || 'col2' || v_b);

    END LOOP;

    CLOSE RETVAL;

    END;

Viewing 3 posts - 1 through 2 (of 2 total)

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