Move cursor

Поиск
Список
Период
Сортировка
От FERREIRA William (COFRAMI)
Тема Move cursor
Дата
Msg-id 1904E3EB39448246A7ECB76DF34A70B00143B473@TOCOMEXC03
обсуждение исходный текст
Ответы Re: Move cursor  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
hi
 
i need to use the MOVE function on a cursor, for extracting special rows.
the function is written in pl/pgSQL
 
CREATE OR REPLACE FUNCTION TEST()
    RETURNS void AS $$
DECLARE

        childCursor CURSOR FOR select * from ... 
        childRecord adoc.xdb_child%ROWTYPE;
        dep int4 :=3;
BEGIN
    OPEN childCursor;
    LOOP
        MOVE FORWARD dep IN childCursor;
        FETCH childCursor INTO childRecord;
        EXIT WHEN not found;  
            raise notice '---> : % | % | %', childRecord.child_id, childRecord.evolution, childRecord.indx;
    END LOOP;
    CLOSE childCursor;

    RETURN void;
END;
$$ LANGUAGE plpgsql;
 
the function doesn't generate any error, but when i try to execute it, i get this message :
 
ERROR:  syntax error at or near "$1" at character 15
QUERY:  MOVE FORWARD  $1  IN  $2
CONTEXT:  PL/pgSQL function "test" line 10 at SQL statement
 
thanks in advance
 
 
    Will

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

Предыдущее
От: Howard Cole
Дата:
Сообщение: Re: Simple query takes 5+ minutes
Следующее
От: Wes
Дата:
Сообщение: Re: Vacuum time degrading