I suppose some workaround would be to introduce temporary cursor:
CREATE OR REPLACE FUNCTION A3() RETURNS VOID AS $BODY$
declare _tmp record;
begin
select * from A1() as dummy ( x double precision ) into _tmp;
end;
$BODY$ LANGUAGE 'plpgsql';
But I'm not sure if this is more effiecent than A3 r
2010/2/19 :
> I suppose some workaround would be to introduce temporary cursor:
>
> CREATE OR REPLACE FUNCTION A3() RETURNS VOID AS $BODY$
> declare _tmp record;
> begin
> select * from A1() as dummy ( x double precision ) into _tmp;
> end;
> $BODY$ LANGUAGE 'plpgsql';
>
> But I'm not sure if thi
On 19/02/2010 09:59, wilcza...@op.pl wrote:
> Hi Ray, thanks for reply. Your solution needs to be modified with alias to
> get executed properly:
>
> CREATE OR REPLACE FUNCTION A3() RETURNS VOID AS $BODY$
> begin
> select * from A1() as dummy ( x double precision );
> return;
> end;
> $BODY$ LA
And what about that :
http://www.postgresql.org/docs/8.4/interactive/xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-SET
Maybe my french english disallowed me to understand right the question,
but I think that this item could help in a way!
Le vendredi 19 février 2010 à 11:04 +0100, Pavel Stehule a
Hi Ray, thanks for reply. Your solution needs to be modified with alias to get
executed properly:
CREATE OR REPLACE FUNCTION A3() RETURNS VOID AS $BODY$
begin
select * from A1() as dummy ( x double precision );
return;
end;
$BODY$ LANGUAGE 'plpgsql';
but when used: select * from A3() it genera
Hi Pavel, thanks for reply. Your solution:
CREATE OR REPLACE FUNCTION A3() RETURNS VOID AS $BODY$
begin
return query select * from A1();
return;
end;
$BODY$ LANGUAGE 'plpgsql';
generates error "cannot use RETURN QUERY in a non-SETOF function" because A3
returns VOID.
"Pavel Stehule" napisa
2010/2/19 :
> Hi Pavel, thanks for reply. Your solution:
>
> CREATE OR REPLACE FUNCTION A3() RETURNS VOID AS $BODY$
> begin
> return query select * from A1();
> return;
> end;
> $BODY$ LANGUAGE 'plpgsql';
>
> generates error "cannot use RETURN QUERY in a non-SETOF function" because A3
> returns
On 18/02/2010 12:05, wilcza...@op.pl wrote:
>
> CREATE OR REPLACE FUNCTION A3() RETURNS VOID AS $BODY$
> begin
> perform A1();
> end;
> $BODY$ LANGUAGE 'plpgsql';
You need to do:
select * from A1();
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
r...@iol.ie
--
Sent via pgsql-general mai
Hello
2010/2/18 :
> I have a function A1 that returns setof records, and I use it in two ways:
> 1) from function A2, where I need results from A1
> 2) from function A3, where I don't need these results, all I need is to
> execute logic from A1
>
> Here ale very simple versions of my functions:
>
I have a function A1 that returns setof records, and I use it in two ways:
1) from function A2, where I need results from A1
2) from function A3, where I don't need these results, all I need is to
execute logic from A1
Here ale very simple versions of my functions:
CREATE OR REPLACE FUNCTION A1()
10 matches
Mail list logo