--Boundary_(ID_y5WB1OucZrLIjsNzKqvLEg)
Content-type: text/plain; charset=us-ascii
Content-disposition: inline
Content-transfer-encoding: 7BIT
Rodrigo
This is how I do it:
CREATE PROCEDURE ...
ON EXCEPTION SET esql, eisam, errmsg;
RAISE EXCEPTION esql. eisam, errmsg;
END EXCEPTION
-- my procedure body here.
END PROCEDURE;
HTH
Sujit
Rodrigo Filipe <rfilipe@soporcel.pt> on 10/07/99 07:15:51 AM
To: informix-list@iiug.org
cc: (bcc: Sujit Pal)
Subject: Question : SPL err_get() equivalent?
--Boundary_(ID_y5WB1OucZrLIjsNzKqvLEg)
Content-type: text/plain; charset=iso-8859-1
Content-disposition: inline
Content-transfer-encoding: quoted-printable
Hello Informix World
I'd like to know if there is a way to get the message error string of a=
n
exception, in a Stored Procedure as the function err_get() do in 4GL.
My Informix Product is INFORMIX-4GL Version 7.20.UE1X2
TIA,
_______________________________________________
Rodrigo Filipe
Dp. Sistemas de Informa=E7=E3o (sv. Desenvolvimento)
SOPORCEL, S.A. - Figueira da Foz - Portugal
mailto:rfilipe@soporcel.pt
Internet : http://www.soporcel.pt
_______________________________________________
=
--Boundary_(ID_y5WB1OucZrLIjsNzKqvLEg)--
↪ replying to Sujit.Pal@bankofamerica.com
> CREATE PROCEDURE ...
> ON EXCEPTION SET esql, eisam, errmsg;
> RAISE EXCEPTION esql. eisam, errmsg;
> END EXCEPTION
> -- my procedure body here.
> END PROCEDURE;
>
>
> My Informix Product is INFORMIX-4GL Version 7.20.UE1X2
AFAIK there is only one sqlerror-number you can use to
pass your own error message to the calling program: -746
Regarding this you can ignore your third paramater using
RAISE EXCEPTION (errmsg) if your esql variable is another
code than -746.
Furthermore, the sqlerror-text you receive using err_msg
in 4GL differs from the text you will get by using errmsg
in an ON EXCEPTION SET (at least some will do).
If these facts aren't important for your program, your
routine will surely do the better job.
Regards,
Chris