help -- cursor inside a function

Поиск
Список
Период
Сортировка
От jprem
Тема help -- cursor inside a function
Дата
Msg-id 3962AA14.FB231C9@srmsoft.co.in
обсуждение исходный текст
Список pgsql-general



hello ,
i have a procedure as below.

-------------------------------------------------------------------------------------------------------------

create function retrec(integer) returns integer
as
 'declare
        uid alias for $1;
  begin
        declare retrec_cur cursor for select * from jd_user_master where

um_user_id>uid;
        if found then
                fetch 1 from retrec_cur;
                move next from retrec_cur;
                return 1;
        end if;
  end;'
language 'plpgsql';

-------------------------------------------------------------------------------------------------------------------------

this gets created , but while running it i get the error below,
-------------------------------------------------------------------------------------------------------------------

NOTICE:  plpgsql: ERROR during compile of retrec near line 5
ERROR:  parse error at or near "cursor"

--------------------------------------------------------------------------------------------------------------------------

why this is so ? can anyone help me out ? thanx in advance.








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

Предыдущее
От: "Kurt Miller"
Дата:
Сообщение: Re[2]: Interface Question
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: How to lock a table