Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: DBI quoting when I don't want it to

by Tardis (Pilgrim)
on Aug 23, 2002 at 00:06 UTC ( [id://192221]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://192221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-29 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found