FAQ
In PostgreSql 8.1 i've tried to use Out parameter but when I've changed
function (added Out parameter)

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

CREATE OR REPLACE FUNCTION reffunc3(FROM_ID in integer,COUNT_ROW OUT
integer) RETURNS SETOF Person AS '
DECLARE
rec RECORD;
BEGIN

SELECT count(*) INTO COUNT_ROW FROM Person WHERE ssn>FROM_ID ;

FOR rec IN SELECT ssn,name FROM Person WHERE ssn>FROM_ID
LOOP
c;RETURN NEXT rec ;
END LOOP ;

RETURN ;
END;
' LANGUAGE plpgsql;



--SELECT * from reffunc3(1) ;
----------------------------------------

i've seen :

----
ERROR: function result type must be integer because of OUT parameters
----

Of course when I change parameter to Integer it must be Record error
appears.

What should I change, and how to call this function?

Mirek

Search Discussions

  • Andreas Kretschmer at May 31, 2006 at 5:04 am

    am 30.05.2006, um 3:21:27 -0700 mailte uran1@o2.pl folgendes:
    In PostgreSql 8.1 i've tried to use Out parameter but when I've changed
    function (added Out parameter)
    ...
    ----
    ERROR: function result type must be integer because of OUT parameters
    ----

    Of course when I change parameter to Integer it must be Record error
    appears.
    A good explanation for IN/OUT-Parameters can you find there:
    http://people.planetpostgresql.org/xzilla/index.php?/archives/149-out-parameter-sql-plpgsql-examples.html#extended


    HTH Andreas
    --
    Andreas Kretschmer (Kontakt: siehe Header)
    Heynitz: 035242/47215, D1: 0160/7141639
    GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
    === Schollglas Unternehmensgruppe ===

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-general @
categoriespostgresql
postedMay 30, '06 at 10:21a
activeMay 31, '06 at 5:04a
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Uran1: 1 post Andreas Kretschmer: 1 post

People

Translate

site design / logo © 2021 Grokbase