Re: context in plpgsql functions

Поиск
Список
Период
Сортировка
От Gianni Mariani
Тема Re: context in plpgsql functions
Дата
Msg-id 3EC59590.6040305@mariani.ws
обсуждение исходный текст
Ответ на Re: context in plpgsql functions  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Ответы Re: context in plpgsql functions  (Gianni Mariani <gianni@mariani.ws>)
Список pgsql-general
Jeff Eckermann wrote:

>--- Ian Barwick <barwick@gmx.net> wrote:
>
>
>>On Friday 16 May 2003 20:46, Gianni Mariani wrote:
>>
>>
>>>I've been using PostgreSQL 7.3.2.
>>>
>>>What, if any, way is there to share a context
>>>
>>>
>>(global rowtype variable)
>>
>>
>>>between plpgsql functions ?
>>>
>>>
>>If you mean something like Oracle's PL/SQL packages,
>>which can
>>contain package global variables, then unfortunately
>>not.
>>
>>
>
>I believe the usual workaround is to insert the values
>in a table which has been created for that purpose.
>
>
Yes - I was thinking of that - I was also thinking you could use a
cursor to do the job of pointing to the record in the table you care about.

However, when I try to do a MOVE cursor inside a plpgsql function i get :

    EXECUTE ''MOVE BACKWARD 1 IN "ContextCursor"''

    psql:kkk4:145: ERROR:  unexpected error -5 in EXECUTE of query 'MOVE
BACKWARD 1 IN "ContextCursor"'

or a

    PERFORM MOVE BACKWARD 1 IN "ContextCursor";

    psql:kkk4:145: ERROR:  parser: parse error at or near "BACKWARD" at
character 14

or

    MOVE BACKWARD 1 IN "ContextCursor";

    psql:kkk4:145: ERROR:  SPI_prepare() failed on "MOVE BACKWARD 1 IN
"ContextCursor""


.... yet that same statement works fine elsewhere ...

Ideas on how to move a cursor inside a plpgsql function ?

TIA



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

Предыдущее
От: Chris Cameron
Дата:
Сообщение: pgAdmin II Download
Следующее
От: Avi Schwartz
Дата:
Сообщение: Re: Result set return to Coldfusion MX?