I think this is simple enough:
DEFINE errmsg CHAR(78);
...
LET errmsg = "Invalid Login ID: " || USER;
-- Or if you have the USER login as a parameter (let's named it p_user):
-- LET errmsg = "Invalid Login ID: " || p_user;
RAISE EXCEPTION -746, 0, errmsg ;
It should work Ok. In any case you could code an additional error
code as the isam error code and make a lookup (or make some corrective
actions depending on this isam 'user defined' error code) of this isam
error code in a table containing your error messages.
Hope it helps,
Octav
scott syau wrote:
>Hi,
>I'm working on stored procedures and find that the error handling
>informix provi
>de
>can't satisfy our needs.
>I want to catch the informix error and also user defined error and sent
>back to
>calling program. I know -746:
>
>-746 message-string
>
>You supply message-string for this message. You can apply this message
>to error conditions that you specify in a stored procedure. The
>corrective
>action for this error depends on the condition that caused it. You, the
>user,
>define both the condition and the message text.
>
>But I need more. For example, the stored procedure check_login() will
>raise error on "Invalid Login_id scott" to calling program with error
>number 100
>1,
>"scott" is from input.
>
>Any suggestion?
>
>
>Scott
>
--
Octav Chiriac Phone: (373) 2 21 20 96
NetInfo S.R.L. Fax: (373) 2 21 36 59
Chisinau (373) 2 24 00 83
Moldova, Republic of mailto:com@netinfo-moldova.com