Skip to Content.
Sympa Menu

freetds - freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Richard Rowell <richard AT bowmansystems.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql
  • Date: Tue, 8 Jan 2002 15:46:07 -0600


Test script:

#!/usr/bin/perl -w
use DBI;
use strict;
my $dbh =
DBI->connect("DBI:Sybase:database=gths_dev;server=192.168.1.142","sa","zxcv1234")
or die "Couldn't connect to database server: " . DBI->errstr;
my $sql = 'SELECT parishname FROM parishes WHERE parishid=?';
my $sth = $dbh->prepare($sql)
or die "Couldn't prepare statement ($sql): " . $dbh->errstr;
$sth->execute(1) # Execute the query
or die "Couldn't execute statement: " . $sth->errstr;
my @data;
while (@data = $sth->fetchrow_array())
{
print @data[0];
}
$sth->finish;
$dbh->disconnect;

This script fails on the prepare:
Couldn't prepare statement (SELECT parishname FROM parishes WHERE
parishid=?): Server message number=10000 severity=7 state=0 line=1
server=OpenClient text=Dynamic placeholders only supported under TDS 5.0 at
./test.pl line 8.

Now I tried to connect with TDS V5 ( with and without a recompiled tds and
used the tdsLevel=CS_TDS_50 when connecting) and the call to connect() just
hangs.

So, is there any way to prepare statements with SQL Server 7 with
placeholders?




Archive powered by MHonArc 2.6.24.

Top of Page