RAISERROR_UDF (VARCHAR, DOUBLE, DOUBLE, ARRAY)

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