Flavio Palumbo wrote:
Well, I made a little tool where a user can submit free SQL statements ...
I'd like to parse it before submitting to trap sintax errors.

So I assume you are looking to make sure that well-formed SQL statements are created before the statement is sent to the real database. I guess that a statement such as:

  SELECT A,B FROM T

needs to be seen as valid, even if T does not exist, or A, B are not valid columns in T.

Derby does not support that yet, but it's possible to add that type of functionality. I could imagine something like a database type of 'syntax' that would only provide syntax checking on a prepare, e.g. a JDBC URL of

 jdbc:derby:syntax:

There would be no store behind this "database", just the SQL layer of Derby. In the past I've run Derby like this to show how the layers are independent of each other, i.e. a storeless Derby that could perform any SQL query that did not go against a real database object (e..g VALUES 1).

I've been messing with the some code in this area now (and in the past) so I'll look into making progress on this for the next major release of Derby.

Dan.

Reply via email to