in reply to Re: DBI quoting when I don't want it to
in thread DBI quoting when I don't want it to
I don't quite see the problem. The code that converts +1 month into SQL knows that it is producing SQL at that point, so you can set it up to either produce SQL or produce a quoted date string. What am I missing? You need to post some actual code for your real problem to become obvious.Hard to post code that will explain the problem, as the SQL is all generated dynamically with a bunch of crufty addons to a slice of nasty legacy code :-)
The key is that I'm using placeholders, and when I pass something like 'DATE(NOW() + INTERVAL '1 month')' via a placeholder, it gets quoted as a string, and it doesn't work.
I beleive that's the bit you're missing :-)
As others have mentioned, I can either not use placeholders (bad, IMHO) or do the date maniplulations in perl rather than in SQL. A third option is to do an extra 'SELECT' of my own to deduce the actual modified date.
I've decided to hold off on it for a while. It wasn't a key feature, and I mainly wanted it because (I thought) implementation would be easy and the details could be left to SQL. If the user typed in a b0rked date interval, it would just raise an SQL exception.
|
---|