Hi,
Could you please give me some help? I would like to call a function from
another. There are three functions, (say fa(int,int), fb(int,int) and
fc(int,int)). What's the problem with this:
create function "fc" (int, int) returns int as'
declare
x alias for $1;
y alias for $2;
begin
perform fa (x,y);
perform fb (x,y);
end;
' language 'plpgsql'
Or this:
create function "fc" (int, int) returns int as'
declare
x alias for $1;
y alias for $2;
begin
execute ''select fa('' || x || '','' || y || '')'';
execute ''select fb('' || x || '','' || y || '')'';
end;
' language 'plpgsql'
Or this:
create function "fc" (int, int) returns int as'
declare
x alias for $1;
y alias for $2;
begin
execute ''select fa('' || quote_literal(x) || '','' || quote_literal(y) ||
'')'';
execute ''select fb('' || quote_literal(x) || '','' || quote_literal(y) ||
'')'';
end;
' language 'plpgsql'
I tried all of them above. When I called them one after another from the
console, they worked proprely. But calling the composite function it did
nothing. No errors, just does not do anything.
How should I call these functions.
Thank you in advance,
Csaba