freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Michael Peppler <mpeppler AT peppler.org>
- To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
- Subject: Re: 4.2 limitation...
- Date: Tue, 2 Jan 2001 11:51:49 -0800 (PST)
mjn writes:
> > 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.
You can also do:
$state = 'ca';
my $sth = $dbh->prepare("SELECT * FROM authors WHERE state = '$state'");
or use the q() and qq() operators, like so:
my $sth = $dbh->prepare(qq(SELECT * FROM authors WHERE state = "$state"));
Michael
--
Michael Peppler - Data Migrations Inc. - mpeppler AT peppler.org
http://www.mbay.net/~mpeppler - mpeppler AT mbay.net - AIM MPpplr
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: ase-linux-list AT isug.com
-
4.2 limitation...,
mjn, 01/02/2001
- <Possible follow-up(s)>
- Re: 4.2 limitation..., Mark Schaal, 01/02/2001
- Re: 4.2 limitation..., Tom Samplonius, 01/02/2001
- Re: 4.2 limitation..., mjn, 01/02/2001
- Re: 4.2 limitation..., Michael Peppler, 01/02/2001
- Re: 4.2 limitation..., Roger Burton West, 01/02/2001
- Re: 4.2 limitation..., Michael Peppler, 01/02/2001
- Re: 4.2 limitation..., mjn, 01/04/2001
- Re: 4.2 limitation..., Michael Peppler, 01/04/2001
Archive powered by MHonArc 2.6.24.