Received: from web3204.mail.yahoo.com ([204.71.202.201]) by hub.org (8.9.3/8.9.3) with SMTP id LAA87659 for ; Fri, 26 May 2000 11:58:49 -0400 (EDT) (envelope-from ntwebdeveloper@yahoo.com) Message-ID: <20000526155818.9972.qmail@web3204.mail.yahoo.com> Received: from [207.7.33.232] by web3204.mail.yahoo.com; Fri, 26 May 2000 08:58:18 PDT Date: Fri, 26 May 2000 08:58:18 -0700 (PDT) From: Peter Landis Subject: POSTGRESQL and PERL? To: "pgsql-sql@postgresql.org" Cc: "pgsql-sql@postgresql.org" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200005/161 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/