Re: [SQL] Recursive pl/pgsql function ...

2006-10-16 Thread Markus Schaber
Hi, Marc, Hi, Tom, Tom Lane wrote: > "Marc G. Fournier" <[EMAIL PROTECTED]> writes: >> More then one Record: >> # select get_next_billing_date(activated, 12) from company_details; >> ERROR: control reached end of function without RETURN >> CONTEXT: PL/pgSQL function "get_next_billing_date" > >

Re: [SQL] Recursive pl/pgsql function ...

2006-10-15 Thread Marc G. Fournier
--On Sunday, October 15, 2006 23:27:34 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: More then one Record: # select get_next_billing_date(activated, 12) from company_details; ERROR: control reached end of function without RETURN CONTEXT: PL/pgSQL f

Re: [SQL] Recursive pl/pgsql function ...

2006-10-15 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > More then one Record: > # select get_next_billing_date(activated, 12) from company_details; > ERROR: control reached end of function without RETURN > CONTEXT: PL/pgSQL function "get_next_billing_date" Hm, what PG version is this? I couldn't dupli

[SQL] Recursive pl/pgsql function ...

2006-10-15 Thread Marc G. Fournier
'k, this isn't quite working as expected (or, rather, hoped) ... I've created a recursive function (that does work nicely) that takes a date in the past, and keeps advancing in steps of 'n months' until the date is in the future: CREATE OR REPLACE FUNCTION get_next_billing_date(timestamp with