in reply to Escaping SQL correctly

Amazingly, DBI has a feature called "placeholders" that does this sort of thing. See DBI Placeholders and Bind Values.

Replies are listed 'Best First'.
Re^2: Escaping SQL correctly
by Anonymous Monk on Mar 08, 2006 at 01:30 UTC

    And I'd love to use them, but I don't see how I can get a DBI handle without connecting to a database. My program won't have access to the database when it runs.

    If there's no other way to do it, I suppose I could install a dummy database with no data in it for DBI to connect to, but I'd still need to get access to the SQL generated as a string instead of sending it to the database.