我必須捕獲執行存儲過程時發生的異常消息。在下面存儲的proc中,proc執行並捕獲遇到的第一個異常。但是,一旦遇到異常,我存儲的proc就會退出。有沒有一種方法可以讓存儲的proc在遇到異常後繼續運行繼續執行sql存儲過程,儘管有例外
請幫助!
PROCEDURE Test_script (OUT XYZRow)
BEGIN
DECLARE Veiw_Name VARCHAR(2147483647);
DECLARE Object_Name VARCHAR(2147483647);
DECLARE Object_Type VARCHAR(2147483647);
DECLARE Domain_Name VARCHAR(2147483647);
DECLARE Status VARCHAR(2147483647);
DECLARE "READ" VARCHAR(100);
DECLARE PUBLIC SetException EXCEPTION;
for r as select
*
from table1 do
for r2 as SELECT
r1.name as Object_Nam,
r1.nameType as Object_Typ,
r1."domain" as domain_nam,
CASE r1.Status AS Status,
CASE r1.c_R AS READ_Stat
FROM function_xyz(r.PATH) r1
do
set Veiw_Name = r.PATH;
set Object_Name = r2.Object_Nam;
set Object_Type = r2.Object_Typ;
set Domain_Name = r2.domain_nam;
set Status = r2.Status;
set "READ" = r2.Read_Stat;
INSERT INTO XYZRow VALUES (Veiw_Name, Object_Name, Object_Type, Domain_Name, Status, "READ");
end for;
end for;
EXCEPTION
WHEN System.SystemException THEN
CALL PRINT(CURRENT_EXCEPTION.MESSAGE);
END
這看起來像T-SQL不是Oracle PLSQL。你有正確的標記嗎? – kevinsky
它實際上在思科信息服務器早期稱爲複合軟件..數據虛擬化工具..後端是oracle數據庫雖然...希望這有助於! – user5704279
任何人都可以幫我解決這個問題嗎? – user5704279