What's wrong with this function

Поиск
Список
Период
Сортировка
От Najm Hashmi
Тема What's wrong with this function
Дата
Msg-id 3A858290.270E2473@mondo-live.com
обсуждение исходный текст
Ответы Re: What's wrong with this function  (Jie Liang <jliang@ipinc.com>)
Re: What's wrong with this function  (<plpgsql@polar-digital.com>)
Список pgsql-sql
Hi all,Here  is a plpgsql function:
flipr'#create function test_cur() returns text as'
flipr'# declare
flipr'#  mycur  cursor for select title from songs where song_id=10;
flipr'#  usr        record;
flipr'#  results    text;
flipr'# begin
flipr'#  open mycur;
flipr'#  fetch next from mycur into usr;
flipr'#  close mycur;
flipr'#  results:= usr.title;
flipr'#
flipr'# end;
flipr'# ' language 'plpgsql';
CREATE
flipr=# select test_cur() as Title;
NOTICE:  plpgsql: ERROR during compile of test_cur near line 2
ERROR:  parse error at or near "cursor"

What I am doing wrong?
Thanks in advance for your help.
Regards, Najm




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

Предыдущее
От: Najm Hashmi
Дата:
Сообщение: pgsql and cursor
Следующее
От: Jie Liang
Дата:
Сообщение: Re: pgsql and cursor