I'd like to test whether given SQL statement is syntactically and semantically valid (ie. no syntax errors and no field misspellings).
For most databases Connection.prepareStatement
and PreparedStatement.getMetaData
would do the trick (no exception == good query). Unfortunately Oracle's newest driver only parses like this only SELECT queries, but not other kind of queries. Older drivers don't do even that.
Is there some other facility provided by Oracle for parsing SQL statements?