I have an application that allows users to type in SQL statement that my application will then store for later use. I would like to make sure, at time of submission, that the user has put in a valid SQL statement for the particular database that they are planning to run it against. But I would prefer not to actually execute the statement, especially if it is an UPDATE or INSERT, which it could be. I'm aware of SQL::Statement, but I need a few things it doesn't provide:
- support for DBMS-specific syntax
- permissions check on the tables/views/functions accessed
- check for other DBMS-specific limitations (i.e. 4000 char max string literal length in Oracle)
In other words, I need to be able to do this through DBI itself so that the actual database will tell me that my statement is or isn't valid given the username/schema I'm accessing.
What methods are there through DBI or some other module that might allow this? What about DB-specific methods if there are no generic ones (my main targets are Oracle, DB2 and MySQL)? Thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.