Re: [GENERAL] Recursive function

2013-11-23 Thread Alban Hertroys
On 22 Nov 2013, at 21:56, Juan Daniel Santana Rodés wrote: > Hi everyone... > I have a problem. I am programming a recursive function in plpgsql language. > This function use a cursor and when the function try to call the same > function throw a exception that it say me that the cursor is usin

Re: [GENERAL] Recursive function

2013-11-22 Thread David Johnston
Juan Daniel Santana Rodés wrote > Hi everyone... > I have a problem. I am programming a recursive function in plpgsql > language. This function use a cursor and when the function try to call > the same function throw a exception that it say me that the cursor is > using. > My friends how I can to

Re: [GENERAL] Recursive function that receives a list of IDs and returns all child IDs

2011-03-24 Thread Sven Haag
thanks a lot! that function does it exactly as wished ;)! Am 23.03.2011 22:46, schrieb Merlin Moncure: On Wed, Mar 23, 2011 at 10:29 AM, Sven Haag wrote: hello pgsql fans out there, i've already created a function that returns a list of IDs of all sub-samples based on a given sample ID. th

Re: [GENERAL] Recursive function that receives a list of IDs and returns all child IDs

2011-03-23 Thread Jens Kapp
i guess an array is also ok. must been something like: fn_get_subsamples(IN sample_numbers[] integer) ?? how would a query then look like? SELECT * FROM sample WHERE sample_number IN ( fn_get_subsamples(1,2,3,4) ) ?? cheers sven Am 23.03.2011 17:42, schrieb Tom Lane: "Sven Haag" writes

Re: [GENERAL] Recursive function that receives a list of IDs and returns all child IDs

2011-03-23 Thread Merlin Moncure
On Wed, Mar 23, 2011 at 10:29 AM, Sven Haag wrote: > hello pgsql fans out there, > > i've already created a function that returns a list of IDs of all sub-samples > based on a given sample ID. this works fine. now i like to extend this > function so that it can receive a list of sample IDs. e.g.

Re: [GENERAL] Recursive function that receives a list of IDs and returns all child IDs

2011-03-23 Thread Sven Haag
i guess an array is also ok. must been something like: fn_get_subsamples(IN sample_numbers[] integer) ?? how would a query then look like? SELECT * FROM sample WHERE sample_number IN ( fn_get_subsamples(1,2,3,4) ) ?? cheers sven Am 23.03.2011 17:42, schrieb Tom Lane: "Sven Haag" write

Re: [GENERAL] Recursive function that receives a list of IDs and returns all child IDs

2011-03-23 Thread Tom Lane
"Sven Haag" writes: > hello pgsql fans out there, > i've already created a function that returns a list of IDs of all sub-samples > based on a given sample ID. this works fine. now i like to extend this > function so that it can receive a list of sample IDs. e.g.: > fn_get_subsamples(IN sample_

Re: [GENERAL] recursive function

2007-07-09 Thread Karen Springer
Hi, Thanks Pavel. Here's my working function. Maybe it will save someone else some time. CREATE OR REPLACE FUNCTION "Production_Tracking"."GetTopLevelParent"() RETURNS SETOF record AS $BODY$ DECLARE initial_rec RECORD; rec RECORD; parentbc varchar; toplevelparentbc varchar; BEGIN FOR in

Re: [GENERAL] recursive function

2007-06-13 Thread Pavel Stehule
Hello please, look on http://people.planetpostgresql.org/merlin/index.php?/archives/2-Dealing-With-Recursive-Sets-With-PLPGSQL.html Regards Pavel Stehule 2007/6/13, Karen Springer <[EMAIL PROTECTED]>: Hi, I am struggling to write my first recursive function and think I'm missing something bas

Re: [GENERAL] recursive function

2005-12-20 Thread Jim C. Nasby
On Tue, Dec 20, 2005 at 06:58:41PM +0100, Klein Bal?zs wrote: > In practice however this doesn?t seem to work as the function never returns. > > Should this work in theory? Is this the recommended approach? I can' think of any reason why it wouldn't work; have you tried adding RAISE statements to