Re: POSTGRESQL and PERL? - Mailing list pgsql-sql

From Ed Loehr
Subject Re: POSTGRESQL and PERL?
Date
Msg-id 392EA7D7.BD13724E@austin.rr.com
Whole thread Raw
In response to POSTGRESQL and PERL?  (Peter Landis <ntwebdeveloper@yahoo.com>)
List pgsql-sql
Peter Landis wrote:
> 
> but what if you have a variable set like:
> $sort_selection = "name";
> 
> How do you sort by the variable?
> 
> For instance you cannot do...
> $sqh = $dbh->prepare(q{select name from company order
> by $sort_selection;});

Why not?  The query string is created before prepare is called...

Regards,
Ed Loehr


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: aliases break my query
Next
From: "Richard Huxton"
Date:
Subject: Re: POSTGRESQL and PERL?