|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: RE: CTlib.pm error
Date: Nov 10 2004 4:59PM
On Wed, 2004-11-10 at 17:50, Sabherwal, Balvinder (MBS) wrote:
> I do have ct_callback() in the script if that is what you are referring to
> ad-hoc error handler and it's printing the error messages returned by srv_cb
> and msg_cb. The script dies just before the error check which is the line
> ct_sql(). It's not going pass this line so I can't print the error messages
> in the script.
Try rewriting that section to do the following:
my $dbdata;
ct_callback(CS_SERVERMSG_CB, sub { print "@_\n"; });
ct_callback(CS_CLIENTMSG_CB, sub { print "@_\n"; });
$dbhS->ct_execute($execsql);
while($dbhS->ct_results($restype) == CS_SUCCEED) {
next unless($dbhS->ct_fetchable($restype));
while(@data = $dbhS->ct_fetch) {
push(@$dbdata, [@data]);
}
}
this code *should* produce the same results as your ct_sql() call, and
it should be easier to figure out where it is dying.
Michael
> From: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org] On
> Behalf Of Michael Peppler
> Sent: Wednesday, November 10, 2004 11:40 AM
> To: 'sybperl-l@peppler.org'
> Subject: RE: CTlib.pm error
>
> Well - something's got to die in there somewhere.
>
> The ct_res_info() should only fail if there is no result set to fetch.
> Then the ct_cancel() error message occurs if a ct_fetch() returns
> CS_FAIL *and* if a ct_cancel() also returns CS_FAIL.
> The latter usually means that the connection has been marked "dead". Do
> you have ad-hoc error handlers installed in your script?
> If so, could you disable them while you run this code, or replace them
> with something that prints out *all* the messages that they receive?
>
> Michael
>
> On Wed, 2004-11-10 at 17:22, Sabherwal, Balvinder (MBS) wrote:
> > Nop!
> >
> > -----Original Message-----
> > From: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org] On
> > Behalf Of Michael Peppler
> > Sent: Wednesday, November 10, 2004 11:02 AM
> > To: 'sybperl-l@peppler.org'
> > Subject: RE: CTlib.pm error
> >
> > OK - well that's weird. The ct_res_info() call will normally only fail
> > if the communication with the server has a problem of some sort. Are you
> > sure that you don't get any other errors?
> >
> > Michael
> >
> > On Wed, 2004-11-10 at 15:20, Sabherwal, Balvinder (MBS) wrote:
> > > Sybase errorlog is clean and there are no errors reported what so ever.
> > >
> > > -----Original Message-----
> > > From: Michael Peppler [mailto:mpeppler@peppler.org]
> > > Sent: Wednesday, November 10, 2004 1:58 AM
> > > To: Sabherwal, Balvinder (MBS)
> > > Cc: 'sybperl-l@peppler.org'
> > > Subject: Re: CTlib.pm error
> > >
> > > On Tue, 2004-11-09 at 20:30, Sabherwal, Balvinder (MBS) wrote:
> > > > Hi list,
> > > >
> > > > I'm getting error upon running one of my scripts as below. This
> happens
> > > asap
> > > > the sql is sent to the ASE for execution via ct_sql() method.
> > > >
> > > > The same script is working fine for another ASE and is failing for
> this
> > > ASE
> > > > server. Any pointers on this? Below is the debug output.
> > >
> > > > DB<4>
> > > > ct_res_info() failed at
> > > >
> > >
> >
> /usr/local/ActivePerl-5.6/lib/site_perl/5.6.1/sun4-solaris-thread-multi/Syba
> > > > se/CTlib.pm line 906.
> > >
> > > Take a look at the Sybase server error log. My guess is that you'll see
> > > a stack trace of some sort that corresponds with this request.
> > >
> > > Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler@peppler.org http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html
|