raise_error
function
Applies to: Databricks SQL Databricks Runtime
Throws an exception with expr
as the message.
Syntax
raise_error(expr)
Arguments
expr
: ASTRING
expression.
Returns
The NULL
type.
The function raises a runtime error with expr
as the error message.
Applies to: Databricks SQL Databricks Runtime 14.2 and later
The returned error class is USER_RAISED_EXCEPTION
and the SQLSTATE
is P0001
.
See Handling error conditions for details on handling error conditions.
Examples
> SELECT raise_error('custom error message');
[USER_RAISED_EXCEPTION] custom error message SQLSTATE: P0001
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for