RAISE (Snowflake Scripting)¶
Raises an exception.
For more information about exceptions, see Handling exceptions.
Note
This Snowflake Scripting construct is valid only within a Snowflake Scripting block.
- See also:
Syntax¶
Where:
exception_nameThe name of the exception to raise.
If you are handling an exception in an exception handler and you want to raise the same exception again, omit this argument. See Raising the same exception again in an exception handler in Snowflake Scripting.
Examples¶
This creates and raises (but does not catch) a simple exception:
Here is the call to the stored procedure that raises the exception:
Here is the output of executing the stored procedure that raises the exception:
The next example is similar to the preceding example, but uses an exception for which the user defined a custom exception number and exception message:
Here is the output of executing the stored procedure that raises the exception:
For more examples, see the examples for handling an exception.