Skip to Content.
Sympa Menu

freetds - Re: 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: "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: Wed, 9 Jan 2002 10:21:55 -0800



Hi Brian, I rigged up this capability and will generate some traces and send
them to you off the list. Thanks very much for doing this!

Eric


> From: Brian Bruns
> Sent: Tuesday, January 08, 2002 6:28 PM
>
> I don't feel this is really an issue with busy-ness (many other
> things are
> though). The basic issue here is getting a network trace of a working
> placeholder query, the rest should be easy. So if anyone has the
> capability of a) creating/finding an example program using placeholders
> under win32 (my guess being it'd have to be ODBC) and b) getting
> a network
> capture using ethereal/tcpdump, it should be fairly straight forward to
> implement (especially now that there is preliminary TDS 5 stuff, all the
> ctlib pieces are in place).
>
> Brian
>
> On Tue, 8 Jan 2002, Eric Deutsch wrote:
>
> >
> > 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')
> > >
> >
> >
> > ---
> > You are currently subscribed to freetds as: [camber AT ais.org]
> > To unsubscribe, forward this message to
> $subst('Email.Unsub')
> >
>
>
> ---
> You are currently subscribed to freetds as: [edeutsch AT systemsbiology.org]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')
>





Archive powered by MHonArc 2.6.24.

Top of Page