in reply to Checking SQL Syntax

I think I saw once a module to do this on CPAN. Did you search there? Maybe e.g. SQL::Statement can help you?