in reply to DBI - validate SQL without executing
But you can teach it about DBMS specific data types, functions, and operators with the CREATE and DROP commands for types, functions and operators. For example if your DBMS doesn't support BLOB as a data type, issuing $dbh->do("DROP TYPE blob") before you begin will cause it to reject the word BLOB when used as a data type. "CREATE TYPE foo" will do the reverse - accept "foo" as a data type. The same works with functions and some operators (e.g. SLIKE or RLIKE).
The other thing you can do is use S::S as a first pass validator - in other words, you could use it to filter out all of the statements it recognizes as valid and then the ones that are left over you'd need to deal with some other way.
Let me know if you need more specifc tips.
|
|---|