Skip to Content.
Sympa Menu

freetds - Re: 4.2 limitation...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Mark Schaal <mark AT champ.tstonramp.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: 4.2 limitation...
  • Date: Tue, 2 Jan 2001 11:22:28 -0800 (PST)


>
> Is there a way to sidestep the limitation of 4.2 and dynamic SQL
> placeholders?
>
> Or is there a way to use a variable in an SQL statement like this:
>
> $state="ca";
> my $sth = $dbh->prepare('SELECT * FROM authors WHERE state = $state');
>
> All of the variable syntax itterations that I know have failed...
>
> Thanks again...
>
> Mike Neuharth


Single quoted strings don't do variable interpolation in perl, try
my $sth = $dbh->prepare("SELECT * FROM authors WHERE state = $state");

Alternatively you can create a (temporary) stored procedure on the
server and then call that with the desired variables.

Hope that helps,

Mark
--
Mark J. Schaal Phone: (909) 620-7724
TST On Ramp Fax: (909) 620-8174
System Administrator E-Mail: mark AT tstonramp.com




Archive powered by MHonArc 2.6.24.

Top of Page