From: Peter Landis <ntwebdeveloper@yahoo.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: POSTGRESQL and PERL?
Date: Fri, 26 May 2000 08:58:18 -0700 (PDT)
Message-ID: <20000526155818.9972.qmail@web3204.mail.yahoo.com> (raw)
Hi-
I'm a newbie at postgresql and was working on
sorting by category. What my question is, how do you
sort by category when using a variable. For instance,
you can sort by name in perl by doing:
$sqh = $dbh->prepare(q{select name from company order
by name;});
$sqh->execute();
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 ?;});
$sqh->execute($sort_selection);
OR
$sqh = $dbh->prepare(q{select name from company order
by $sort_selection;});
$sqh->execute();
If anyone could help, I would greatly appreciate it.
Thanks again!
__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: ntwebdeveloper@yahoo.com
Subject: Re: POSTGRESQL and PERL?
In-Reply-To: <20000526155818.9972.qmail@web3204.mail.yahoo.com>
References: <20000526155818.9972.qmail@web3204.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox