Alexander Farber (EED) writes:
> Hi,
>
> I have the following simple stored prcedure,
> which returns 1 on any error or 0 on success:
You can use the syb_do_proc_status, if you only need to know
success/failure status:
syb_do_proc_status (bool)
Setting this attribute causes $sth->execute() to fetch
the return status of any executed stored procs in the
SQL being executed. If the return status is non-0 then
$sth->execute() will report that the operation failed
(ie it will return undef). This will NOT cause an
error to be raised if RaiseError is set, however. To
get that behaviour you need to generate a user error
code in the stored proc via a
raiserror <num> <errmsg>
statement.
Setting this attribute does NOT affect existing $sth
handles, only those that are created after setting it.
To change the behavior of an existing $sth handle use
$sth->{syb_do_proc_status}.
The default is for this attribute to be off.
If the return status can be more than a fail/success value then I
would fetch it in a normal fetch loop and check the result type
(CS_STATUS_RESULT).
Michael
--
Michael Peppler - Data Migrations Inc. - [EMAIL PROTECTED]
http://www.mbay.net/~mpeppler - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: [EMAIL PROTECTED]