Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
JP10
JP10
SSC-Enthusiastic
SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)

Group: General Forum Members
Points: 104 Visits: 618
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;
Jo Pattyn
Jo Pattyn
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1589 Visits: 9720
Do you have a recent version of sql developer? . Have to research it myself
JP10
JP10
SSC-Enthusiastic
SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)SSC-Enthusiastic (104 reputation)

Group: General Forum Members
Points: 104 Visits: 618
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;
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search