RAISERROR_UDF (VARCHAR, DOUBLE, DOUBLE, ARRAY)

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Definition

This user-defined function (UDF) throws an exception with a specific message.

RAISERROR_UDF(MSG_TEXT VARCHAR, SEVERITY DOUBLE, STATE DOUBLE, PARAMS ARRAY)

Parameters

MSG_TEXT VARCHAR

The message text of the error message.

SEVERITY DOUBLE

The severity number for the error.

STATE DOUBLE

The state number for the error message.

PARAMS ARRAY

The additional information of the error message.

Returns

Returns a varchar with an error message.

Usage example

Input:

SELECT RAISERROR_UDF('<\<%*.*s>> TEST', 1.0, 1, array_construct());

Output:

MESSAGE: <<undefined>> TEST, LEVEL: 1, STATE: 1

Last updated