postgresql and perl?

Поиск
Список
Период
Сортировка
От Peter Landis
Тема postgresql and perl?
Дата
Msg-id 20000525211636.7075.qmail@web3201.mail.yahoo.com
обсуждение исходный текст
Список pgsql-general
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/

В списке pgsql-general по дате отправления:

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: problem with NOTICE: _outNode: don't know how to print type
Следующее
От: Herbert Liechti
Дата:
Сообщение: Re: postgresql and perl?