Re: Return code from system function.
Posted in 1998
Topics: Stored Procedures & SPL
Ray O'Hagan wrote:
> Hi,
>
> I'm running Informix 7.32 on Windows NT server 4.0, and
> within a SP I'm executing a system command - but how
> do I return the return code to my calling application.
> I've tried the ON EXCEPTION and it didn't work e.g.
>
> CREATE PROCEDURE dummy(p_file char(35))>
> <defines removed>
>
> on exception set sql_err, isam_err, err_info
>
> return 1;
>
> end exception;
>
> system "c:\\bin\\runme.exe"
>
> return 0;
>
> END PROCEDURE;
>
> The command executes fine and returns a non-zero on
> error, but the SP never gets the exception and hence
> always returns 0 to me.
>
> Is this the right way to do this, or should I go
> about it differently.
>
> TIA.
>
> Ray.
system calls can not return parameters back to the SPL. If you really
need to do it then pass it back via a table and get the calling program
to check the table
--
Paul Watson #
WF Software Ltd # I don't suffer from stress -
Tel: +44 1436 674729 # I'm a carrier.
Fax: +44 1436 678693 #
www.wfsoftware.co.uk #