Re: plpgsql

Поиск
Список
Период
Сортировка
От dim
Тема Re: plpgsql
Дата
Msg-id 420DD3F7.6030000@gmx.net
обсуждение исходный текст
Ответ на Re: plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
>>Am I missing anything or is
>>record assignment not possible in plpgsql?
>
>
> Your example works fine for me in PG 8.0.  There were some improvements
> in this area since 7.*, though I'm not sure offhand whether they were
> material to this particular case.
strange.
laik is the table with rows nr integer and txt varchar.

CREATE OR REPLACE FUNCTION tst1(integer) RETURNS laik AS '
  SELECT * FROM laik where nr=$1;
' LANGUAGE 'sql';

CREATE OR REPLACE FUNCTION tst2(integer) RETURNS varchar AS '
DECLARE
    v laik;
BEGIN
    v := tst1($1);
    RETURN 1;
END;
' LANGUAGE 'plpgsql' VOLATILE;

if i try to 'select tst2(1);'
I get the following error message:
ERROR: syntax error at or near "v"
CONTEXT: compile of PL/pgSQL function "tst2" near line 4

I'm using Postgresql 7.4.3. Will try this with 8, but even if it works
with 8, it's not good - I don't know on what version of postgre my db
will later reside.

Thanks,
dim



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: plpgsql
Следующее
От: Kjetil Haaland
Дата:
Сообщение: Re: function returning a row