Re: [GENERAL] [ask] Return Query

2009-03-16 Thread ataherster
thanks Tom Lane, my problem resolved, I'm trying to re-create my table and function, and this working well Tom Lane wrote: ataherster writes: ... but this function is not work with this error : ERROR: structure of query does not match function result type CONTEXT: PL/pgSQL fun

[Fwd: Re: [GENERAL] [ask] Return Query]

2009-03-15 Thread ataherster
on is : whether that bug in postgreSQL? I feel afraid if will happen again like this by itself thanks before for your help Note : I'm sory about my english, my english is very bad Justin wrote: ataherster wrote: hai all, i'm trying create function like this CREATE OR R

[GENERAL] [ask] Return Query

2009-03-14 Thread ataherster
hai all, i'm trying create function like this CREATE OR REPLACE FUNCTION penjualan(idcb integer) RETURNS SETOF penjualan AS $BODY$ BEGIN IF ($1 IS NULL) THEN return query SELECT * FROM PENJUALAN; ELSE return query SELECT * FROM PENJUALAN WHERE IDCABANG=$1; END IF; END; $BODY$ LANGUAGE 'plpg