RE: CTlib.pm error

"Sabherwal, Balvinder (MBS)" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <FD09F5C4F598CB4DAB9453CDC42AD6F101DF2909@mbs-mail-17.mortgagesvcs.com>
Thanks Michael, This helps to identify the problem. One thing more I'd like
to know is how to print these messages to the output file?

Will something like this work where FH is the file handle?

ct_callback(CS_SERVERMSG_CB, sub { print FH "@_\n"; });
ct_callback(CS_CLIENTMSG_CB, sub { print FH "@_\n"; });


Thanks
-----Original Message-----
From: Michael Peppler [mailto:[email protected]] 
Sent: Wednesday, November 10, 2004 11:59 AM
To: Sabherwal, Balvinder (MBS)
Cc: '[email protected]'
Subject: RE: CTlib.pm error

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.