From: Guy Rouillier <guyr-ml1@burntmail.com>
To: pgsql-general@postgresql.org
Subject: Re: NEED URGENT HELP....
Date: Mon, 25 Dec 2006 18:45:31 -0500
Message-ID: <4590629B.9070808@burntmail.com> (raw)
In-Reply-To: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com>
References: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: guyr-ml1@burntmail.com, pgsql-general@postgresql.org
Subject: Re: NEED URGENT HELP....
In-Reply-To: <4590629B.9070808@burntmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox