parametrized query

Поиск
Список
Период
Сортировка
От Ben Kim
Тема parametrized query
Дата
Msg-id Pine.GSO.4.10.10404281036520.5854-100000@edsun.coe.tamu.edu
обсуждение исходный текст
Ответы Re: parametrized query  (Andreas Schmitz <a.schmitz@cityweb.de>)
Список pgsql-admin
I tried but couldn't find an answer if this is possible in psql.

Create a file named test.sql
    select * from mytable where id = ? (or use $1, $2...)
Then in psql do
    \i test.sql 337

to achieve the same effect "select * from mytable where id=337"

as I would in perl
    $sth = $dbh -> prepare ("insert into mytable values (?, ?, ?)")

Is writing a function the only way? Is there another way that can be done
without writing a function?

Thanks,
Ben Kim


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: [JDBC] [PERFORM] is a good practice to create an index on the
Следующее
От: Andreas Schmitz
Дата:
Сообщение: Re: parametrized query