From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | tlund79 <thomas(dot)lund(at)eniro(dot)no> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Returning data from multiple functions |
Date: | 2011-11-10 12:53:24 |
Message-ID: | CAFj8pRDHQG_tU54qNQyUo0Cg-BwF3MqfH4iQ7mJrBEVQYoCq0A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
2011/11/10 tlund79 <thomas(dot)lund(at)eniro(dot)no>:
> I know got this far thanks to Pavle Stehule. The function worked and returned
> the data when the variables was predefined after "return query".
>
> When tried to replace these with variables passed through the function call
> I got this message;
> ERROR: syntax error at or near "RETURN"
> LINE 1: ...ll select ppr_pf_inn_antall( $1 , $2 , $3 , $4 , $5 ) RETURN
> ^
> QUERY: select ppr_pf_inn_verdi( $1 , $2 , $3 , $4 , $5 ) union all select
> ppr_pf_inn_antall( $1 , $2 , $3 , $4 , $5 ) RETURN
> CONTEXT: SQL statement in PL/PgSQL function "ppr_test_to_funk" near line 7
>
>
>
> CREATE OR REPLACE FUNCTION ppr_test_to_funk(aarstall int, frauke int, tiluke
> int, prosjektkode int[], teamkode int[])
> RETURNS setof integer AS
> $BODY$
>
> I called the function with this: select * from
> ppr_test_to_funk(2011,1,52,array[3], array[7,4])
>
> Am I lost or are this possible?
>
> *Updated function:*
>
> BEGIN
> return query
> select ppr_pf_inn_verdi($1,$2,$3,$4,$5)
> union all
> select ppr_pf_inn_antall($1,$2,$3,$4,$5)
>>> MISSING SEMICOLON HERE!!!
>
> RETURN;
> END;
> $BODY$
> LANGUAGE plpgsql VOLATILE
> COST 100;
> ALTER FUNCTION ppr_test_to_funk()
> OWNER TO oystein;
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/Returning-data-from-multiple-functions-tp4980747p4980786.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Kellerer | 2011-11-11 08:07:40 | Re: ORACLE PROCEDURE TO POSTGRES FUNCTION -ERROR IN THE OVER PART |
Previous Message | tlund79 | 2011-11-10 11:37:12 | Re: Returning data from multiple functions |