In your update statement, you have only defined
three bind parameters (?), but in execute(),
you have defined more than three bind values...
HTH.
Stacy Mader.
-----Original Message-----
From: Michael Gargiullo
To: Dbi-Users-Help; Dbi Perl
Sent: 29/03/2002 6:06 PM
Subject: updating a DB
Hey all.. I'm new to connecting to a DB from Perl.
I followed the instructions in Linux Journal on how to install DBI, and
Freetds to connect to MS sql sever 2k. I can connect and get data, (It
included a test script), but I want to update rows in a DB. The data is
going to change so I wanted to use variables in the query. I followed
some
code on dbi.perl.org, but get a few errors
Errors:
Couldn't prepare queries; aborting:
No such file or directoryServer message number=10000 severity=7 state=0
line=1 server=OpenClient text=Dynamic placeholders only supported under
TDS 5.0 at ./zip.pl line 31.
This is the code I'm using. How can I achive my goal...
my $dbh = DBI->connect('DBI:Sybase:server=192.168.0.2', $user, $pass)
or die "Can't connect to database: $DBI::errstr\n" .
DBI->errstr;
my $insert_handle = $dbh->prepare('UPDATE zipcodes SET county=?,
areacode=?
Where zip = ?')
or die "Couldn't prepare queries; aborting:\n$!" . $dbh->errstr;
$insert_handle->execute($arr[0], $arr[1], $arr[2], $arr[3], $arr[4],
$zip)
or return 0 . dbh->errstr;
Thank you,
Mike