Re: NEED URGENT HELP.... - Mailing list pgsql-general

From Guy Rouillier
Subject Re: NEED URGENT HELP....
Date
Msg-id 4590629B.9070808@burntmail.com
Whole thread Raw
In response to NEED URGENT HELP....  ("Sandip G" <sandip@singapore.com>)
Responses Re: NEED URGENT HELP....  ("Henrique P Machado" <zehrique@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Harpreet Dhaliwal"
Date:
Subject: Re: NEED URGENT HELP....
Next
From: Guy Rouillier
Date:
Subject: Re: Need some Technical support !!!