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

[GENERAL] Recursive function

2013-11-22 Thread Juan Daniel Santana Rodés
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 resolve this problem. Regards!! -- Sent

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_

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

2011-03-23 Thread Sven Haag
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_numbers SETOF integer) here

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

[GENERAL] recursive function

2007-06-13 Thread Karen Springer
Hi, I am struggling to write my first recursive function and think I'm missing something basic. I have written 2 functions that work if I pass over one parameter, but if I try to pass over a series of parameters say in a view for every field in the table it seems to run but never displays da

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

[GENERAL] recursive function

2005-12-20 Thread Klein Balázs
hi, though I have worked for a while with SQLServer2000 but I am new to Postgres (and also new to using mailing lists), so please bear with me if I am slower to pick these up.   I am trying to write a function in plpgsql that returns a group of people. The group is defined by a set of