| Author |
Prepared statements
|
Yasir Qureshi
Greenhorn
Joined: Apr 26, 2006
Posts: 24
|
|
Hi, I am using preapared statments, I was just wondering what if my in clause is dynamic, I am passing CSV values in my 'in' clause and not calling .set methods, for example select a.* from A a where a.id in (params) Params is string that is dynamically generated and its a CSV not string having question marks, i.e.: (1,2,3) not (?,?,?) In this case will this query be considered as a single query and compiled once or it is considered separate query and compile every time. Thanks in advance, Yasir.
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
It's a separate query each time you send a unique combination of parameters. But your query is so simple that the analyze and compile cost / time can't be a lot. Regards, Jan
|
OCUP UML fundamental
ITIL foundation
|
 |
Yasir Qureshi
Greenhorn
Joined: Apr 26, 2006
Posts: 24
|
|
Thank for reply Jan, so it means in this case using Prepared statement is not going to make very big difference. Yasir.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26173
|
|
"Yasir", We're pleased to have you here with us here at JavaRanch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it. In particular, your display name must be a first and a last name separated by a space character. Thanks, Jeanne Forum Bartender
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: Prepared statements
|
|
|