Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 5B6289FA2FD for ; Mon, 25 Dec 2006 13:32:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 09958-04 for ; Mon, 25 Dec 2006 13:32:18 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by postgresql.org (Postfix) with ESMTP id 488FC9F939F for ; Mon, 25 Dec 2006 13:32:18 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so4667777nfb for ; Mon, 25 Dec 2006 09:32:17 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=iNoNxaxDQDNN3De1xghFhGyM2PUaSBYz/krgfMzwEnq9vJvGW1/yvb86NA/xA1jPj/9l3NOhVum/+uZaPaawG6feSnhIMNKZcl0iZ5a/AZhPOZdVmXO4WbUt0lMR1SoCqMWR8T4qz/BG+fJ0alZl7R0vbmI++vJiH2Lt6o93HBU= Received: by 10.49.29.3 with SMTP id g3mr15092148nfj.1167067937192; Mon, 25 Dec 2006 09:32:17 -0800 (PST) Received: by 10.49.40.14 with HTTP; Mon, 25 Dec 2006 09:32:17 -0800 (PST) Message-ID: Date: Mon, 25 Dec 2006 23:02:17 +0530 From: "Harpreet Dhaliwal" To: "Sandip G" Subject: Re: [GENERAL] NEED URGENT HELP.... Cc: pgsql-bugs@postgresql.org, pgsql-sql@postgresql.org, pgsql-general@postgresql.org In-Reply-To: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_45854_14539657.1167067937150" References: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/212 X-Sequence-Number: 16600 ------=_Part_45854_14539657.1167067937150 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 want your query to work. ~Harpreet On 12/21/06, Sandip G wrote: > > 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, > AddInfo1, AddInfo2 > FROM T_PHASE > WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3) > $BODY$ > LANGUAGE 'sql' VOLATILE; > > > When I run > select * from sp_get_phase ('sandip', 'oms', '4') returns 1 > record.....this works fine.... > > select * from sp_get_phase ('sandip', 'oms', '1') returns 1 > record.....this also works fine... BUT > > select * from sp_get_phase ('sandip', 'oms', '1,4') this return a Blank > record. > > I tried to execute the SQL statement from the function > > SELECT BOOK_NO, USER_ID, COMPANY_ID, PHASE, UPDATE_USER_ID, > UPDATE_DATE, > AddInfo1, AddInfo2 > FROM T_PHASE > WHERE (USER_ID = 'testUser') AND (COMPANY_ID = 'testCompany') > AND BOOK_NO IN (1,4) > > ----- This Works fine... returns 2 records. What may be the problem? > > Thanks in advance. > Regards, > Sandip. > > > > -- ------=_Part_45854_14539657.1167067937150 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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 want your query to work.
 
~Harpreet

 
On 12/21/06, Sandip G <sandip@singapore.com> wrote:
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,
                      AddInfo1, AddInfo2
FROM            T_PHASE
WHERE           (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3)
$BODY$
  LANGUAGE 'sql' VOLATILE;


When I run
select * from sp_get_phase ('sandip', 'oms', '4')   returns 1 record.....this works fine....

select * from sp_get_phase ('sandip', 'oms', '1')  returns 1 record.....this also works fine... BUT

select * from sp_get_phase ('sandip', 'oms', '1,4') this return a Blank record.

I tried to execute the SQL statement from the function

SELECT          BOOK_NO, USER_ID, COMPANY_ID, PHASE, UPDATE_USER_ID, UPDATE_DATE,
                      AddInfo1, AddInfo2
FROM            T_PHASE
WHERE           (USER_ID = 'testUser') AND (COMPANY_ID = 'testCompany') AND BOOK_NO IN (1,4)

----- This Works fine... returns 2 records.   What may be the problem?

Thanks in advance.
Regards,
Sandip.
 

--

------=_Part_45854_14539657.1167067937150--