By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,203 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,203 IT Pros & Developers. It's quick & easy.

Prepared Statement for IN function

P: 20
Could anyone please tell me if it is possible to use prepared statement in postgresql for IN function? if its possible then hows it done? What I want to have would look something like this,

prepare my_query as
select something from sometable
where some_column IN ($1);
execute my_query('lookup_value','lookup_value','lookup_val ue')

Please let me know how this could be achieved in Postgresql,

Tons of Thanks
Jan 21 '08 #1
Share this Question
Share on Google+
3 Replies


P: 20
Does someone have an answer for it? Please let me know as am designing my classes and it depends on this now.

Thanks a lot
Jan 22 '08 #2

Expert 100+
P: 700
Could anyone please tell me if it is possible to use prepared statement in postgresql for IN function? if its possible then hows it done? What I want to have would look something like this,

prepare my_query as
select something from sometable
where some_column IN ($1);
execute my_query('lookup_value','lookup_value','lookup_val ue')

Please let me know how this could be achieved in Postgresql,

Tons of Thanks
I'm not sure if I get you problem because the query you wrote works fine but you must write that statement will receive a parameter

prepare my_query(int) as
select something from sometable
where some_column IN ($1);

Did't it work with your postgres?
Jan 22 '08 #3

P: 20
Sorry my bad, query works fine.
Jan 22 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.