Re: Calling functions from within pl/pgsql

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Calling functions from within pl/pgsql
Дата
Msg-id 162867790712040541j296bbc8dt9383293690872c64@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Calling functions from within pl/pgsql  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-sql
Hello

a := exprx

is internally translated : get result of SELECT exprx and store it to a

so you can write select sin(10);  then you can a := sin(10)

but you can too use subselect like:

SELECT (SELECT v FROM foo LIMIT 1) ~ you can write

a := (SELECT v FROM foo LIMIT 1);

that is equal to SELECT INTO a v FROM foo

Pavel


> > http://www.postgresql.org/docs/8.2/interactive/plpgsql-statements.html#PLPG
> >SQL-STATEMENTS-ASSIGNMENT
>
> Sure, i missed the
> "As explained above, the expression in such a statement is evaluated by means
> of an SQL SELECT command sent to the main database engine. The expression
> must yield a single value."
> part.
> Thanx.
>
> >
> > Regards
> > Pavel Stehule
> >
> > > --
> > > Achilleas Mantzios
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 6: explain analyze is your friend
>
>
>
> --
> Achilleas Mantzios
>


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

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Calling functions from within pl/pgsql
Следующее
От: Ehab Galal
Дата:
Сообщение: marking tuples