FYI, here's the subroutine I use to submit an SQL statement. (Note that it's
intended to only return the last row of results, if there are any. $dbh is a
global variable, and the argument to &sql is the SQL query text.)
sub sql {
my ($text) = @_;
my @row = ();
my $lastresult = "";
@dbresult = ();
$dbh->dbcmd("$text\n");
$dbh->dbsqlexec;
$dbh->dbresults;
while (@row = $dbh->dbnextrow) {
push(@dbresult, join("\t", @row));
$lastresult = $row[0];
}
$dbh->dbcancel; ## clear out the buffer
return $lastresult;
# should there be a check for SQL Server errors somewhere in here?
}
Thanks in advance!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
Status values are documented in the sybdb.h header file in the OpenClient
include directory. A better approach to what you're trying to do, however,
would be to add a message handler which watches for a 1205 message, which is
sent by the server to any process which is killed as a result of deadlock
resolution.
Rich Miller
richard....@norwest.com
Norwest Mortgage