Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recursive functions

Status
Not open for further replies.

teroy

Programmer
Oct 17, 2000
67
0
0
AU
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';
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top