Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I've been using DBI + SQL::Abstract for a lot of stuff, and one of the things I need to do now is generate concrete SQL scripts. For example, SQL::Abstract makes converting a hash into an insert extremely simple:
But, now I have an occasion where I need to get parameter-free SQL to execute in a (My)SQL script. E.g., given the above example, I'd like to turn $insert and @bind back into: INSERT INTO atable ( a, b, c) VALUES ( NULL, 1, 'string' )Part of the problem is terminology. The only keywords I can think of { SQL, literal, abstract, bind, parameters, quoting } all get tons of results in the direction I've been using SQL::Abstract. (That is: ways to use tools like DBI that promote the use of placeholders, etc.) I'm wondering whether there's a DBD driver that will do this. (e.g. change the connect string to something like 'DBI:fakesql:dialect=mysql', where 'fakesql' is the module I'm unable to find) Or is there another tool that I'm overlooking? In reply to Concrete SQL from SQL::Abstract? by benizi
|
|