Re: [GENERAL] help w/ SRF function

2007-09-23 Thread Ow Mun Heng
On Tue, 2007-09-18 at 02:24 -0700, Trevor Talbot wrote: On 9/17/07, Ow Mun Heng [EMAIL PROTECTED] wrote: CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate timestamp, code text) LANGUAGE 'sql' IMMUTABLE STRICT; But If I were to use ALIASINg, I get an error

Re: [GENERAL] help w/ SRF function

2007-09-19 Thread A. Kretschmer
am Mon, dem 17.09.2007, um 9:21:22 +0800 mailte Ow Mun Heng folgendes: CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate timestamp, code text) RETURNS SETOF foo AS $BODY$ SELECT TRH.ID, TRH.data1, TRH.data2, FROM D INNER JOIN TS

Re: [GENERAL] help w/ SRF function

2007-09-19 Thread Ow Mun Heng
On Wed, 2007-09-19 at 07:57 +0200, A. Kretschmer wrote: am Mon, dem 17.09.2007, um 9:21:22 +0800 mailte Ow Mun Heng folgendes: CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate timestamp, code text) RETURNS SETOF foo AS $BODY$ SELECT TRH.ID, TRH.data1,

Re: [GENERAL] help w/ SRF function

2007-09-18 Thread Ow Mun Heng
On Mon, 2007-09-17 at 09:42 +0800, Ow Mun Heng wrote: On Mon, 2007-09-17 at 09:21 +0800, Ow Mun Heng wrote: Hi, I want to use a SRF to return multi rows. current SRF is pretty static. create type foo_type as ( id smallint data1 int data2 int ) CREATE OR REPLACE

Re: [GENERAL] help w/ SRF function

2007-09-18 Thread Trevor Talbot
On 9/17/07, Ow Mun Heng [EMAIL PROTECTED] wrote: CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate timestamp, code text) LANGUAGE 'sql' IMMUTABLE STRICT; But If I were to use ALIASINg, I get an error eg: DECLARE DECLARE fromdate ALIAS for $1; todate

[GENERAL] help w/ SRF function

2007-09-18 Thread Ow Mun Heng
Hi, I want to use a SRF to return multi rows. current SRF is pretty static. create type foo_type as ( id smallint data1 int data2 int ) CREATE OR REPLACE FUNCTION foo_func() RETURNS SETOF foo AS $BODY$ SELECT TRH.ID, TRH.data1, TRH.data2, FROM D

Re: [GENERAL] help w/ SRF function

2007-09-16 Thread Ow Mun Heng
On Mon, 2007-09-17 at 09:21 +0800, Ow Mun Heng wrote: Hi, I want to use a SRF to return multi rows. current SRF is pretty static. create type foo_type as ( id smallint data1 int data2 int ) CREATE OR REPLACE FUNCTION foo_func() RETURNS SETOF foo AS $BODY$ SELECT