Is it possible to call a stored procedure within another in Oracle?

1142920 pts.
Tags:
Oracle
Stored Procedures
In Oracle, would I be able to call a stored procedure from within another procedure? Here's what I have so far:
SET SERVEROUTPUT ON;

DROP PROCEDURE test_sp_1;
DROP PROCEDURE test_sp;

CREATE PROCEDURE test_sp
AS
BEGIN
    DBMS_OUTPUT.PUT_LINE('Test works');
END;
/

CREATE PROCEDURE test_sp_1
AS
BEGIN
    DBMS_OUTPUT.PUT_LINE('Testing');
    test_sp;
END;
/

CALL test_sp_1;
What should I do next? Thanks.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You are actually calling test_sp from test_sp_1, so, not sure what you want to do next.

But, in Oracle you don’t execute stored procedures using the “CALL” word.  If you are running it from SQL*Plus or SQL Developer, you need to do it with ‘EXECUTE’.

In your example:

execute test_sp_1;

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: