| < Day Day Up > |
The RAISE_ERROR Function
The
RAISE_ERROR
function is a different type of function than we have discussed so far. It is not a column function because it does not take a
Instead, the
RAISE_ERROR
function is used to raise an error condition in the SQLCA. The
The
RAISE_ERROR
function can be used to signal application program and data problems. One situation where
RAISE_ERROR
may
SELECT EMPNO,
CASE WHEN SEX = 'M' THEN 'MALE '
WHEN SEX = 'F' THEN 'FEMALE'
ELSE RAISE_ERROR('70SX1', 'INVALID DATA, SEX IS NEITHER F NOR M.')
END
FROM DSN8810.EMP;
The value specified for SQLSTATE must conform to the following rules:
NOTE Technically, the RAISE_ERROR function does return a value. It always returns NULL with an undefined data type. You must use the CAST function to cast it to a defined data type to return the value to a program. |
| < Day Day Up > |
| < Day Day Up > |
MQSeries Built-in Functions
NOTE When performing either the MQREAD or MQREADCLOB function the operation does not remove the message from the queue specified in the first expression. Additionally, for both functions, if no messages are available a NULL is returned.
NOTE When performing either the MQRECEIVE or MQRECEIVECLOB function, the operation will remove the message from the queue specified in the first expression. Additionally, for both functions, if no messages are available a NULL is returned.
Using these scalar functions you can easily read, retrieve, and send information from and to MQSeries message queues. The scalar functions operate one message at a time. At times, though, you might want to
NOTE
When performing any of the MQSeries functions that read or receive data, an operation returns a table with the following
|
| < Day Day Up > |