Originally posted by Vishakha Ahuja: What is dynamic sql ?
defining your sql at runtime, rather than compile time. I guess Statement could be considered dynamic too if you use a variable to define part of the query string at runtime. static SQL: "select * from emp" dynamic SQL: "select * from emp where id = ?" for a PreparedStatement "select * from emp where id = '" + stringVariable + "'" for a Statement Jamie
Poornima Ganesh
Greenhorn
Joined: Aug 16, 2001
Posts: 9
posted
0
Iam also trying dynamic sql. U have given eg. "select * from emp where id = '" + stringvar + "' "; if id is integer and i want to check against a dynamic integer variable how do u write the code? i mean if id is also integer and, "select * from emp where id = integervariable "; i would appreciate if anyone replies quickly . Thanks. Poornima.
Originally posted by Poornima Ganesh: if id is integer and i want to check against a dynamic integer variable how do u write the code? i mean if id is also integer and, "select * from emp where id = integervariable "; i would appreciate if anyone replies quickly . Thanks. Poornima.
almost: "select * from emp where id = " + integervariable the only difference is that single quotes are not needed around integer values Jamie
Poornima Ganesh
Greenhorn
Joined: Aug 16, 2001
Posts: 9
posted
0
Thanks for the response. My code is working now.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.