hi there. I would like to call a function within a function but am having troubles
here is my function
The place where its giving an error is
select return_shit(temp); which is where i'm trying to call the function.
Thanks in advance
create function return_shit (int4) returns int4 as '
declare
idvar alias for $1;
test int4;
begin
select parent into test from categories where id=idvar;
if test > 0 then
select return_shit(temp);
end if;
return test;
end;
' language 'plpgsql';
here is my function
The place where its giving an error is
select return_shit(temp); which is where i'm trying to call the function.
Thanks in advance
create function return_shit (int4) returns int4 as '
declare
idvar alias for $1;
test int4;
begin
select parent into test from categories where id=idvar;
if test > 0 then
select return_shit(temp);
end if;
return test;
end;
' language 'plpgsql';