Re: stored procedure and return values
Peter Sinnott <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Oct 12, 2005 at 05:03:01PM +0200, Torsten Bauer wrote: > hi peter, > > isql for example returns -6 as the result status and i thought i can > catch this with sybperl..... > > and $DBI::errstr is empty after my loop...? > Try capturing $DBI::err (numeric error code ) or $DBI::errstr (error string ) straight after the execute. I find it best to capture these straight after the error as I worry they might get reset. Looking in the result set resets them it seems. Thanks Peter > thanks > torsten > > Peter Sinnott schrieb: > > >On Wed, Oct 12, 2005 at 03:09:13PM +0200, Torsten Bauer wrote: > > > > > >>hi all > >> > >>when i run the procedure proctest with isql the return status is -6. > >> > >>i try to catch this in perl but i can't get it.. i used different ways > >>and this is the latest one - based on the documentation: > >> > >>has someone an idea what i do wrong? it seems i'm going mad.. > >> > >> > >> > > > >I imagine since the execute fails there will be nothing useful on > >the statement handle. > > > >What do you need the return code for? > > > >If you need to trap the error the execute fails and $DBI::err is set to > >208(missing object) > > > >http://manuals.sybase.com/onlinebooks/group-as/asg1250e/svrtsg/@Generic__BookTextView/12631 > > > > > >Unless you need to get the same return code from isql and perl this should > >be enough. > > > > > > > -- We exist to authoritatively leverage existing enterprise-wide data in order to solve business problems