Re: [GENERAL] NEED URGENT HELP....

2006-12-28 Thread Sandip G
ssage - From: "Gurjeet Singh" To: "Martijn van Oosterhout" , "Henrique P Machado" , "Guy Rouillier" , pgsql-general@postgresql.org, "Sandip G" Subject: Re: [GENERAL] NEED URGENT HELP Date: Tue, 26 Dec 2006 20:39:01 +0530 It works M

Re: [GENERAL] NEED URGENT HELP....

2006-12-26 Thread Iannsp
Martijn van Oosterhout escreveu: On Mon, Dec 25, 2006 at 08:52:52PM -0300, Henrique P Machado wrote: WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3) Could'nt he use an array in this 3rd parameter? I think so, if it's written: AND BOOK_NO = ANY($3) Have a nic

Re: [GENERAL] NEED URGENT HELP....

2006-12-26 Thread Gurjeet Singh
It works Martijn... but with a few changes will be required in your function Sandip; you will have to pass an ARRAY constructor and return a SETOF record. Here's a sample: postgres=> create table tab ( a int, b int ); CREATE TABLE postgres=> insert into tab values ( 1, 9 ); INSERT 0 1 postgres=>

Re: [GENERAL] NEED URGENT HELP....

2006-12-26 Thread Martijn van Oosterhout
On Mon, Dec 25, 2006 at 08:52:52PM -0300, Henrique P Machado wrote: > WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3) > > Could'nt he use an array in this 3rd parameter? I think so, if it's written: AND BOOK_NO = ANY($3) Have a nice day, -- Martijn van Oosterhout

Re: [GENERAL] NEED URGENT HELP....

2006-12-25 Thread Henrique P Machado
WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3) Could'nt he use an array in this 3rd parameter? -- ZehRique

Re: [GENERAL] NEED URGENT HELP....

2006-12-25 Thread Guy Rouillier
Sandip G wrote: > WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3) > select * from sp_get_phase ('sandip', 'oms', '1,4') this return a > Blank record. $3 is a parameter marker for a single value. You cannot supply a comma-separated list of values and expect it

Re: [GENERAL] NEED URGENT HELP....

2006-12-25 Thread Harpreet Dhaliwal
select * from sp_get_phase ('sandip', 'oms', '1,4') this return a Blank record it would match ur query against '1,4' for the corressponding field in the table. do u really have one such value for that field in your table, i mean '1,4' ?? it won't search for 1 and 4 separately if that is what you

[GENERAL] NEED URGENT HELP....

2006-12-25 Thread Sandip G
I am using PostgreSql 8.1 with pgAdmin III. OS is XP. this is my function: CREATE OR REPLACE FUNCTION sp_get_phase(character varying, character varying, character varying) RETURNS ret_dv_sp_get_phase AS $BODY$ SELECT BOOK_NO, USER_ID, COMPANY_ID, PHASE, UPDATE_USER_ID, UPDATE_DATE