freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql
- From: "Michael Horowitz" <michael.horowitz AT storagenetworks.com>
- To: freetds AT franklin.oit.unc.edu
- Subject: Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql
- Date: Tue, 8 Jan 2002 17:17:52 -0500
Hello,
I don't know what the problem is but I noticed some of the things you
tried were wrong. I read all this in the FAQ and the Users Guide...
TDS 5.0 doesn't work with Microsoft SQL Server, only Sybase SQL Server.
For Microsoft SQL Server 7.0 and above, you can use "4.2" or "7.0".
You don't have to recompile to use different TDS protocol versions.
The "--with-tdsver" flag for configure is only to set the default TDS
version that is used if none is specified in the freetds.conf or
interfaces file.
I haven't tried it recently, but I remember a long time ago I tried to use
prepared statements with a really old version of Sybase SQL Server and
Sybase's JDBC drivers, and it said it wasn't supported.
I don't know if it is supposed to be supported now or what the issues are,
but that is my experience with it.
Someone else is going to have to help you resolve this, but I hope I
cleared up a few things.
--Mike
> 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?
-
freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql,
Richard Rowell, 01/08/2002
- <Possible follow-up(s)>
- Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql, Michael Horowitz, 01/08/2002
- Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql, Eric Deutsch, 01/08/2002
- Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql, Brian Bruns, 01/08/2002
- Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql, Eric Deutsch, 01/09/2002
Archive powered by MHonArc 2.6.24.