freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql
- From: "Eric Deutsch" <edeutsch AT systemsbiology.org>
- To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
- Subject: Re: freetds .53 & DBD-SYbase .93 Prepare fails when placeholders in sql
- Date: Tue, 8 Jan 2002 15:00:53 -0800
Placeholder support has not yet been implemented to MS SQL Server in
FreeTDS. Experimental support only exists for Sybase (TDS 5.0).
Placeholder support for MS SQL Sever is definitely on the "to do" list, but
those with the know-how to do it have just been too busy lately. I too am
very interested in having placeholder support for MS SQL Server, but don't
have the skills to implement it myself.
Eric
> -----Original Message-----
> From: Michael Horowitz
>
> 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?
>
> ---
> You are currently subscribed to freetds as: [edeutsch AT systemsbiology.org]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')
>
-
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.