FM wrote:
On 12 Mrz., 16:49, Serge Rielau <srie...@ca.ibm.comwrote:
FM wrote:
Hi there:
My question is about checking my sql-syntax against DB2UDB V9
throug JDBC 2.0
Is there a way to check my syntax,for example "select * from T1"?
Can you define "checking"?
If you want an SQL Syntax checker within JDBC take a look at Data
Studio, especially pureQuery.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Sorry that i was not clear enough.
What i mean is if i could check that my sql-syntax is correct and if
columns and tables i use are correct too.
Sure - "prepare" the statement (there's probably something like a
prepareStatement() method in Java somewhere).
While it's possible to syntax check a statement prior to execution
(with whatever code you can get your hands on - e.g. Serge's pureQuery
suggestion, or Celko's mimer suggestion), checking whether the
referenced columns and tables are correct is only going to be possible
by actually preparing or executing the statement (preferably the
former).
Cheers,
Dave.