http://qs321.pair.com?node_id=121314


in reply to Is there a module to generate SQL queries?

I think DBIx::Recordset may do what you're looking for.

What it does is allow you to construction you SQL statements using a hash, with the hash keys mapping to field names, and the hash values mapping to the data in those fields. There is an article that appeared on perl.com that provides some examples of what all can be done with DBI::Recordset. Copying one of their examples, this seems to do what you are desiring:
DBIx::Recordset->Insert({%formdata,%dsn});

It can't get too much easier then that :-) However, the article also gives other examples of some pretty nifty things you can do with that module.

Additionally, to be fair to all sides, chromatic published an article in response to the one I linked above describing how you can use DBI to do similar tasks, and how best to make use of DBI's featureset.

I've never used it before, but I did just notice DBIx::SearchBuilder was uploaded to CPAN. It claims to assist in generating SELECT statements. Good luck!
-Eric