PL/SQL: is there an instruction to completely stop the script execution?

后端 未结 4 972
孤独总比滥情好
孤独总比滥情好 2021-02-13 16:23

I\'m trying to do some checkings on a DB schema at the beginning of a PL/SQL script.

If the checkings give unsuccessful results, I want to stop the script, to prevent th

4条回答
  •  天涯浪人
    2021-02-13 17:14

    Rather than throw an application error, it's much simpler to just use the RETURN keyword which exits the current PL/SQL block very smoothly.

    Just make sure you do a DBMS_OUTPUT.PUT_LINE('Exited because before it to provide the user with a nice message of why you're exiting of course!

提交回复
热议问题