Re: Question about stored procedures

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Question about stored procedures
Дата
Msg-id 20060612122348.GA55839@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Question about stored procedures  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Ответы Re: Question about stored procedures  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-novice
On Mon, Jun 12, 2006 at 11:15:28AM +0200, A. Kretschmer wrote:
> am  12.06.2006, um 10:58:04 +0200 mailte Greg folgendes:
> > i.e I would like the query to be "select name, email from users where userid
> > = @userid"
>
> If you want to execute dynamic querys, read
>
> http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

The above query doesn't need to be dynamic if @userid is the only
part that varies.  Dynamic queries are appropriate when you want
to vary the structure of the query itself, such as which columns
are selected, which table gets selected from, which columns to test
in the WHERE clause, which columns to order by, etc.; or if you
want to defeat plan caching (e.g., when using temporary tables).

--
Michael Fuhr

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

Предыдущее
От: Tom Allison
Дата:
Сообщение: Re: SQL comments
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Question about stored procedures