在Oracle 中呼叫另一個預存程序
問題:
問題:可以從Oracle 中的另一個預存程序呼叫預存程序?如果是這樣,如何實現這一點?
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;
範例程式碼:
解決方案:CALL test_sp_1();
BEGIN test_sp_1; END; /
EXEC test_sp_1
一個 SQL*Plus 指令,是匿名的捷徑區塊。
SQL> CALL test_sp_1(); Testing Test works Call completed. SQL> EXEC test_sp_1 Testing Test works PL/SQL procedure successfully completed. SQL> BEGIN 2 test_sp_1; 3 END; 4 / Testing Test works PL/SQL procedure successfully completed.
以上是一個 Oracle 預存程序可以呼叫另一個預存程序嗎?的詳細內容。更多資訊請關注PHP中文網其他相關文章!