Please consider following scenario:
If you do have access to a running Oracle system which contains the tables in question, you can use dbms_sql.parse()
to check if a given piece of SQL is valid or not.
Regular DML statements are not execute through parse()
, but DDL will be executed immediately. So you might want to check if the SQL is not a DDL statement (or better, only allow certain statements to begin with).
Note that if the database you are connecting to, does not contain the tables used in the SQL, parse()
will throw an error even if the statement is syntactically correct.