Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 98A879F9F2C for ; Mon, 25 Dec 2006 19:45:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 99025-01 for ; Mon, 25 Dec 2006 19:45:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by postgresql.org (Postfix) with ESMTP id 386A59F9B05 for ; Mon, 25 Dec 2006 19:45:50 -0400 (AST) Received: from [127.0.0.1] ([72.66.96.197]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JAU00LEVSNVLAH1@vms044.mailsrvcs.net> for pgsql-general@postgresql.org; Mon, 25 Dec 2006 17:45:32 -0600 (CST) Date: Mon, 25 Dec 2006 18:45:31 -0500 From: Guy Rouillier Subject: Re: NEED URGENT HELP.... In-reply-to: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com> To: pgsql-general@postgresql.org Message-id: <4590629B.9070808@burntmail.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-2022-JP Content-transfer-encoding: 7bit X-Antivirus: avast! (VPS 0662-1, 12/24/2006), Outbound message X-Antivirus-Status: Clean References: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.486 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_SOFTFAIL X-Spam-Level: X-Archive-Number: 200612/1438 X-Sequence-Number: 106376 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 to operate on them. As Harpreet points out, it is interpreting your comma-separated list as a single value. If you know you will always have (e.g.) two values you want to pass, you could code your function with "in ($3, $4)", but if you want a generalized, variable-length list of values in your IN clause, you'd need to use dynamic SQL. -- Guy Rouillier