Re: [SQL] Recursive function

2005-07-04 Thread Nick Stone
Hi, Also you could take a look at the connectby function as this will do what you want with ease and it can be used to sort stuff at the same time, produce tree views of data etc. Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gnanavel Shanmugam S

Re: [SQL] Recursive function

2005-07-04 Thread Gnanavel Shanmugam
solved the problem. The modified function is CREATE or replace FUNCTION get_child_section_types(int) RETURNS setof int AS $$ declare v_section_type_id alias for $1; v_rec record; v_rec1 record; begi

Re: [SQL] recursive function returning "setof"

2002-08-19 Thread Christopher Kings-Lynne
Sent: Monday, August 19, 2002 11:22 PM Subject: Re: [SQL] recursive function returning "setof" > > Thanx Chris, > > but I can't find it. > My Programmer's Guide (.../pgsql/doc/html/xfunc-sql.html) says > >"12.2. Query Language (SQL) Functions >

Re: [SQL] recursive function returning "setof"

2002-08-19 Thread Fritz Lehmann-Grube
Thanx Chris, but I can't find it. My Programmer's Guide (.../pgsql/doc/html/xfunc-sql.html) says "12.2. Query Language (SQL) Functions SQL functions execute an arbitrary list of SQL statements," Nothing about control structures in SQL functions additional to the normal command-line syn

Re: [SQL] recursive function returning "setof"

2002-08-19 Thread Christopher Kings-Lynne
> The problem is: > A SQL-Function cannot be recursive because it cannot call itself, and it can > perform no loops. > A PLPGSQL-Function cannot return sets. It can perform loops. Check the manual- you can do FOR and WHILE loops. 7.3 will be able to return sets from PLPGSQL funcs it seems. Chri