freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Russell Kroboth <rkroboth AT visitraleigh.com>
- To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
- Subject: [freetds] problem with UPDATE query
- Date: Thu, 27 Feb 2003 18:35:38 -0500
I am having a problem using the UPDATE statement in a Perl script with my
new Freetds setup, I was wondering if you could tell me if you can see what
I'm missing or if it's even FreeTDS related at all. I am using unixodbc ,
freeTDS and DBD:Sybase. This script does not update the field as expected:
#!/usr/bin/perl
use DBI;
require "DBconnect.cgi";
$dbh = DBI->connect($data_source, $username, $password, 'Sybase') || die
&DBerror;
$dbh->do("use Partners") || die &DBerror;
$sql="UPDATE deals SET accountno = 'somethingelse' WHERE hotdealnum=15";
$rows=$dbh->do($sql) || die &DBerror;
print "$rows affected\n";
exit;
result: "-1 rows affected"
However if I use a different query it works. For example, the following
script works fine:
#!/usr/bin/perl
use DBI;
require "DBconnect.cgi";
$dbh = DBI->connect($data_source, $username, $password, 'Sybase') || die
&DBerror;
$dbh->do("use Partners") || die &DBerror;
$sql="SELECT accountno FROM deals WHERE hotdealnum = 15";
$sth=$dbh->prepare($sql) || die &DBerror;
$sth->execute() || die &DBerror;
$hashref=$sth->fetchrow_hashref();
print "Value is ".$hashref->{'accountno'}."\n";
$sth->finish();
exit;
result: works as expected, can verify looking at actual value using
enterprise manager.
I tried the same query (UPDATE deals SET accountno = 'somethingelse'
WHERE hotdealnum=15) in Query Analyzer on the Windows server and it worked
fine.
I also tried the query using isql from the Linux box, and it worked fine.
No errors are registered by DBD or FreeTDS's FREETDSDUMP in any of these
cases. What else can I look at? Any feedback would be appreciated! Thanks!
-Rusty
-
[freetds] problem with UPDATE query,
Russell Kroboth, 02/27/2003
- Re: [freetds] problem with UPDATE query, Michael Peppler, 02/27/2003
- <Possible follow-up(s)>
- RE: [freetds] problem with UPDATE query, Russell Kroboth, 02/28/2003
Archive powered by MHonArc 2.6.24.