O'Reilly logo

Oracle Database Administration for Microsoft SQL Server DBAs by Michelle Malcher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Error Handling

With error handling, if something in a procedure fails, it goes to the routine for handling that exception. In SQL Server, the TRY CATCH block can be used for error handling. This is almost like wrapping the code in a transaction with a BEGIN TRY and then executing some code. If errors come up, it goes to the BEGIN CATCH.

BEGIN TRY  . . . . . . . . (T-SQL CodeEND TRYBEGIN CATCH... ... .(Error handling code)END CATCH

With PL/SQL’s exception handling, the errors that are raised can be user-or system-defined.

DECLARE    ........... (variables defined)BEGIN   ........... (Blocks of code)EXCEPTION     WHEN exception_name THEN         ............(Exception handling code)END;

The error functions in SQL Server and Oracle provide information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required