Skip to Content.
Sympa Menu

freetds - Re: 4.2 limitation...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: mjn <mjn AT umn.edu>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: 4.2 limitation...
  • Date: Tue, 2 Jan 2001 13:47:04 -0600 (CST)


> As has been mentioned, single quoted strings are not expanded. That is
> just the way Perl works.

I was trying to change the quotes but I just hadn't thought to change the
quotes on the /whole/ string.

> Plus, you aren't quoting the string. It must be a valid SQL statement,
> and SQL strings must be quoted:
>
> $state="ca";
> my $sth = $dbh->prepare("SELECT * FROM authors WHERE state = \"$state\"");

I actually got it to work this way too:

$state='"ca"';
my $sth = $dbh->prepare("SELECT * FROM authors WHERE state = $state")

Which is better, I don't really know. Probably yours.

> BTW, using "*" in SELECT is never a good idea. If colums are added, or
> moved about, you must rewrite your code. An explicit column list is
> always best.

Thanks for the tip!

____________________________
Mike Neuharth
ADCS Technology Specialist
http://www.umn.edu/adcs

E-Mail : mjn AT umn.edu
Page Mail : 6126486512 AT page.metrocall.com
http://nifty.dsl.visi.com/
____________________________






Archive powered by MHonArc 2.6.24.

Top of Page