Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

how to view a Oracle stored procedure result set in sql developer? Expand / Collapse
Author
Message
Posted Monday, January 28, 2013 4:44 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, December 15, 2014 11:29 AM
Points: 55, Visits: 297
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;
Post #1412699
Posted Monday, January 28, 2013 10:28 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 9:22 PM
Points: 1,403, Visits: 6,900
Do you have a recent version of sql developer? . Have to research it myself
Post #1412760
Posted Tuesday, January 29, 2013 10:32 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, December 15, 2014 11:29 AM
Points: 55, Visits: 297
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;
Post #1413187
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse