Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call procedure from select statement of another procedure

SeshuGiriFeb 19 2013 — edited Feb 19 2013

Is it possible to call procedure from select statement and include the out variable values in the cursor?

Note: I am not giving actual procedures because they are so big

Procedure 1:

  CREATE OR REPLACE PROCEDURE CALL_MAIN_PROC(input_id IN NUMBER,
                      outt_cursor OUT sample_cursor)
  IS
 
  BEGIN
		OPEN outt_cursor FOR
		SELECT A.FIRST,
			   A.SECOND,	
			   B.ONE,
			   B.TWO,
			   CALL_PROC(OUT ONEVAR, OUT TWOVAR) -- call another procedure
		FROM TABLEA A, TABLE B
		WHERE A.ID = B.ID;
  END;

Procedure 2:

CREATE OR REPLACE PROCEDURE CALL_PROC(p_cv OUT DATE, p_num OUT NUMBER) AS
    BEGIN
      SELECT SYSDATE intp p_cv FROM DUAL ;
      p_num := 1;
    END;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 19 2013
Added on Feb 19 2013
3 comments
10,075 views