THROW Statement
Throws an error, causing code execution to jump to an enclosing CATCH block.
Syntax
THROW;
THROW error-message;
Parameters
-
error-message: text (optional)
The value to be returned from theERROR_MESSAGEfunction. If not provided, then the value from the last thrown error is retained; this allows aCATCHblock to re-throw an error without changing it.
Examples
THROW 'Oops';
Throws an error such thatERROR_MESSAGE()returns "Oops".THROW;
Re-throws the last thrown error without changing it. Do this inside of a CATCH block.