Skip to Content.
Sympa Menu

freetds - Re: What SQL syntax can I use with FreeTDS?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: What SQL syntax can I use with FreeTDS?
  • Date: Mon, 22 Jul 2002 13:48:01 -0400 (EDT)


On Mon, 22 Jul 2002, Peppi Vecchio wrote:

> I'm used to using DBI and MySQL but the syntax in DBD::Sybase/SQL
> Server is different. Am I to use Sybase syntax or SQL Server 7.0
> syntax? Specifically I have difficulty passing a string into my
> SELECT query.
>
> my $a1 = "This";
> my $a2 = $dbh->quote( "SELECT COUNT(*) FROM this_table WHERE
> this_column >= $a1" );
> my $sth = $dbh->prepare( $a2 );
> $sth->execute() or die $sth->errstr;

I'll bet not even MySQL lets you get away with "WHERE col >= This"
when you mean "WHERE col >= 'This'." You're mixing up placeholders with
Perl string interpolation. Put single quotes around $a1 inside the
argument to $dbh->quote().

--
Bob Kline
mailto:bkline AT rksystems.com
http://www.rksystems.com





Archive powered by MHonArc 2.6.24.

Top of Page