Returning a setof integer

Поиск
Список
Период
Сортировка
Искать

Returning a setof integer

От:
Juan Francisco Diaz <j-diaz@publicar.com>
Дата:
Hi, me again!
Im trying to return a setof integer from various functions and in all of
them the message when executed is:

WARNING:  plpgsql: ERROR during compile of buscabcollibro near line 6
ERROR:  missing .. at end of SQL expression

The functions are like this:

CREATE OR REPLACE FUNCTION BUSCabColLibro(VARCHAR) RETURNS SETOF INTEGER AS
'

    DECLARE
        Libro ALIAS FOR $1;
        res INTEGER;
    BEGIN

        FOR res IN select cabidaCol from CARPagina where IdLibro =
CAST(Libro AS CHAR) LOOP
            RETURN NEXT res;
        END LOOP;
        return;
    END;

' LANGUAGE 'plpgsql';

Thanks a lot

JuanF
(a newbie migrating dbs)

FAQ