Prepared Statement - subtitution
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ajay_Prabhakaran
Posted On:   Friday, January 11, 2002 01:46 AM

I have an SQL statement as follows
select c form t where c in ('a', 'b', 'c');

Now to use JDBC and PreparedStatement feature. I would like to write the SQL as

select c form t where c in (?, ?, ?);
and then use setString three times for setting my variables.

but due to the fact that the values are not predetermined and are dynamic i would like to use something like

select c form t where c in (?);
and use soemthing with which i can replace with "'a', 'b', 'c'".

How can this be done?

Re: Prepared Statement - subtitution

Posted By:   Anonymous  
Posted On:   Friday, January 11, 2002 02:00 AM

No, I don't think you can do that. You can build on the fly the SQL adding as many '?' and setXXX() you need.


Regards

About | Sitemap | Contact