Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Stored Procedures within Stored Procedures 1

Status
Not open for further replies.

Goodz13

Programmer
Jan 16, 2002
5
CA
Hello,

I am trying to call a stored procedure from another stored procedure. How can this be done?

example:
Code:
CREATE PROCEDURE MYDATABASE.PROC1
    ()

    LANGUAGE SQL   
    BEGIN ATOMIC

    DECLARE MYVAR VARCHAR(10);

    SET MYVAR = CALL MYDATABASE.PROC2();

    END @
   

CREATE PROCEDURE MYDATABASE.PROC2
    (OUT MYVAR VARCHAR(10))

    LANGUAGE SQL   
    BEGIN ATOMIC

    SET MYVAR = 'HELLO';
    
    END @
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top