Re: How can I obtain SQLCODE in SPL ?
Posted in 2003
I can't remember the syntax but it is something like:
RUN
or
SYSTEM
But getting the result us another history... maybe in the documentation...
Chucho!
Francisco Roldan wrote:
> BTW, how can i make a system call from SPL and get back the
> result from the executed system command ?
>
> Thanks in advance
>
> -----Mensaje original-----
> De: Art S. Kagel [mailto:kagel@bloomberg.net]
> Enviado el: Mi'rcoles, 26 de Noviembre de 2003 07:56 a.m.
> Para: informix-list@iiug.org
> Asunto: Re: How can I obtain SQLCODE in SPL ?
>
>
> On Wed, 26 Nov 2003 07:53:53 -0500, Marek Radzewicz wrote:
>
>
>
>>How can I obtain SQLCODE (and sql error message) inside SPL code in
>>Informix ?
>>dbinfo('sqlca.sqlcode') doesn't work ...>
> You have to use EXCEPTION handling to retrieve the SQLCODE and ISAM error
> code:
>
> create procedure some_proc( arg1 int, ... )
> returning int, int, int;>
> DEFINE rtnsql INT; -- place holder for exception sqlcode setting
> DEFINE rtnisam INT; -- isam error code. Should be onpload exit status
> DEFINE final_result INT;
>
> ON EXCEPTION SET rtnsql, rtnisam
> ROLLBACK WORK;
> RETURN -1, rtnsql, rtnisam;
> END EXCEPTION;
>
> BEGIN WORK;
> LET final_result = 0;
> .....
> COMMIT WORK;
> RETURN final_result, 0, 0;
>
> END PROCEDURE;
>
> If you prefer the EXCEPTION handler can simply do nothing other than set the
> variables and fall back to the mainline code where you can test them and
> handle the results yourself;
>
> Art S. Kagel
>
> sending to informix-list
>
--
Atte,
Jesus Antonio Santos Giraldo
-----------------------------------
jeansagi@myrealbox.com
jeansagi@netscape.net
sending to informix-list