SRW.MESSAGE


Description  This procedure displays a message with the message number and text that you specify.  The message is displayed in the format below.  After the message is raised and you accept it, the report execution will continue.
MSG-msg_number:  msg_text.

Syntax
SRW.MESSAGE (msg_number NUMBER, msg_text CHAR);

Parameters
msg_number   Is a number from one to ten digits, to be displayed on the message line.  Numbers less than five digits will be padded with zeros out to five digits.  For example, if you specify 123, it will be displayed as SRW-00123.

msg_text       Is at most 190 minus the msg_number alphanumeric characters to be displayed on the message line.

Restrictions
·         You cannot trap nor change Report Builder error messages.
·         SRW.MESSAGE does not terminate the report execution; if you want to terminate a report after raising a message, use SRW.PROGRAM_ABORT.
·         Any extra spaces in the message string will be displayed in the message; extra spaces are not removed by Report Builder.

Example
/* Suppose you have a user exit named MYEXIT to which you want to 
** pass the values of the SAL column.  Suppose, also, that you want
** to raise your own error if the user exit is not found (e.g., because 
** it is not linked, compiled, etc.).  To do these things, you could 
** write the following PL/SQL in the Format Trigger of the F_SAL field:
*/

/* This trigger will raise your message as follows: 
** MSG-1000: User exit MYEXIT failed. Call Karen Smith x3455.
*/

FUNCTION FOO RETURN BOOLEAN IS
BEGIN
    srw.reference(:SAL);
    srw.user_exit('myexit sal');
EXCEPTION
    when srw.unknown_user_exit then
    srw.message(1000, 'User exit MYEXIT failed.
 Call Karen Smith x3455.');
    raise srw.program_abort;
RETURN (TRUE);
END;