Re: NEED URGENT HELP....

From: Guy Rouillier <guyr-ml1(at)burntmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: NEED URGENT HELP....
Date: 2006-12-25 23:45:31
Message-ID: 4590629B.9070808@burntmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-sql

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Henrique P Machado 2006-12-25 23:52:52 Re: NEED URGENT HELP....
Previous Message Tom Lane 2006-12-25 21:02:58 Re: BUG #2859: related with BUG #2568: autovacuum locks tables and do nothing

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2006-12-25 23:49:09 Re: Need some Technical support !!!
Previous Message Harpreet Dhaliwal 2006-12-25 17:32:17 Re: [GENERAL] NEED URGENT HELP....

Browse pgsql-sql by date

  From Date Subject
Next Message Henrique P Machado 2006-12-25 23:52:52 Re: NEED URGENT HELP....
Previous Message Jan Meyland Andersen 2006-12-25 21:52:03 Related tables to a view