|
|
sybperl-l Archive
Up Prev Next
From: Mike Lucente <ml at indarcorp dot com>
Subject: servermsg_cb in CTlib.c
Date: Dec 1 1998 1:41AM
In an earlier post you suggested ...
"You can write a small module that overloads ct_execute(), and use that in
place of Sybase::CTlib. That module could be as simple as ...
Now in the error handler you should be able to refer to $cmd->{SQL} to
get the SQL string."
I tried that and was looking good until I tried to retrieve $cmd->{SQL}
within my callback routine. It appears, however, that CTlib.c does not
return the connection handle:
else
XPUSHs(&sv_undef);
XPUSHs(sv_2mortal(newSViv(srvmsg->msgnumber)));
XPUSHs(sv_2mortal(newSViv(srvmsg->severity)));
XPUSHs(sv_2mortal(newSViv(srvmsg->state)));
XPUSHs(sv_2mortal(newSViv(srvmsg->line)));
if(srvmsg->svrnlen > 0)
XPUSHs(sv_2mortal(newSVpv(srvmsg->svrname, 0)));
else
XPUSHs(&sv_undef);
if(srvmsg->proclen > 0)
XPUSHs(sv_2mortal(newSVpv(srvmsg->proc, 0)));
else
XPUSHs(&sv_undef);
XPUSHs(sv_2mortal(newSVpv(srvmsg->text, 0)));
PUTBACK;
Am I reading this right? I'm no world-class C programmer ;)
Could you suggest a line of code to embed at line 1505 to return $cmd
and so that I don't wreak havoc on anything else?
Many thanks!
|