Skip to Content.
Sympa Menu

freetds - Re: placeholders in TDS 7.0?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: placeholders in TDS 7.0?
  • Date: Mon, 25 Mar 2002 18:04:45 -0500 (EST)


Eric,

which version of freetds are you using, I checked in some fixes just a
couple of days ago.

Brian

On Mon, 25 Mar 2002, Eric Deutsch wrote:

>
> Has anyone out there actually gotten DBD::ODBC to work with FreeTDS? I
> got it all compiled and configured without too much trouble, but with a
> perl snippet like this:
>
> $dbh = DBI->connect ($dsn, $user_name, $password, \%attr )
> or bail_out ("Cannot connect to database");
> my $sql="SELECT \@\@SERVERNAME AS 'Servername',\@\@VERSION AS 'Version'";
> $sth = $dbh->prepare ($sql) or bail_out ("Cannot prepare query");
> $sth->execute () or bail_out ("Cannot execute query");
>
> print join(" | ",@{$sth->{NAME}}),"\n";
> my (@result) = $sth->fetchrow_array() || bail_out("No records in set!");
> print join(" | ",@result),"\n";
>
> I get:
>
> query = SELECT @@SERVERNAME AS 'Servername',@@VERSION AS 'Version'
> SERVERNAME | VERSION
> No records in set!
> Error ()
> Segmentation fault (core dumped)
>
> So, the connection works. The execute works. I do get the column names
> back as desired (although they're forced to caps which is curious). But
> the result returns empty record set. And then the program appears to seg
> fault after that. More testing indicates that the finish() and the
> disconnect() execute okay, but upon exiting perl, I get the seg fault.
> If I run the same program with DBD::Sybase, I get:
>
> Servername | Version
> MSSQL01 | Microsoft SQL Server 2000 - 8.00.194 (Intel X86)
> Aug 6 2000 00:57:48
> Copyright (c) 1988-2000 Microsoft Corporation
> Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 2)
>
> In general, I use DBD::Sybase for a lot of stuff, it's just the DBD::ODBC
> that's new to me.
>
> So the question I have: has anyone gotten a similar configuration to work
> at all? i.e.
> Red Hat 7.2 +
> Perl 5.6.0 +
> DBI 1.18 +
> DBD::ODBC 0.30 +
> unixODBC 2.0.7 +
> FreeTDS 0.53 latest CVS +
> MS SQL Server 2000 no SP
>
> I cannot seem to even get basic stuff to work.
>
> thanks!
> Eric
>
>
>
> On Sun, 24 Mar 2002, Brian Bruns wrote:
>
> >
> > The message is true, placeholders are only supported under TDS 5.0 (and
> > even then support is flakey). For placeholders with TDS 7.0, I'd
> > recommend trying out DBD::ODBC which supports a bind column type option.
> >
> > Brian
> >
> > On Fri, 22 Mar 2002 wsheldah AT lexmark.com wrote:
> >
> > >
> > >
> > > Hi,
> > >
> > > I'm using freeTDS to access MS SQL Server 2000 from a perl module
> > > running on an
> > > intel linux box, via DBD::Sybase. freeTDS was compiled to use TDS 7.0.
> > >
> > > The problem is when I execute a simple query that has a placeholder,
> > > like
> > > "select name from mytable where id=?" in perl, I get the following error
> > > message:
> > > "Dynamic placeholders only supported under TDS 5.0"
> > >
> > > Are they truly not supported under TDS 7.0, or should the test be
> > > changed to
> > > check for TDS versions less than TDS 5.0 instead of only equal to TDS
> > > 5.0? Any
> > > specific patches available, and if not, would this be safe for me to
> > > patch
> > > directly? Thanks again,
> > >
> > > Wes Sheldahl
> > >
> > >
> > >
> > > ---
> > > 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