> > I have a simple void function:
> >
> > CREATE OR REPLACE FUNCTION myfn(myparam OUT int) AS $$ BEGIN
> >    pnr := 1;
> > END;
> > $$ LANGUAGE plpgsql;
> >
> > How do I access myparam?
> > I thought this should work with 9.1/9.2: SELECT (myfn()).myparam; Or 
> > inside another function?
>
> You get the above to load?
> I get:
> ERROR:  "pnr" is not a known variable
> LINE 4:   pnr := 1;

The following all works under 9.2:

CREATE OR REPLACE FUNCTION myfn(myparam OUT int, myparam2 OUT int) AS $$ BEGIN
        myparam := 1;
        myparam2 := 2;
END;
$$ LANGUAGE plpgsql;


select myparam from myfn();
select myparam2 from myfn();
select myfn();
select * from myfn();

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to