in reply to Re: Can I tell if DBI's quote() was used?
in thread Can I tell if DBI's quote() was used?

"foo bar" could be foo bar already quoted or "foo bar" that hasn't been quoted.

That's a good point I hadn't thought of. I'm not sure how much I'm worried about that, though. If SQL will consider it a literal (and not a syntax error or someone's SQL injection attack), that may be close enough. Then again, maybe not.

You should be more worried about numbers than about NULL.

Why's that?

Replies are listed 'Best First'.
Re^3: Can I tell if DBI's quote() was used?
by ikegami (Patriarch) on Apr 07, 2008 at 03:09 UTC
    Because NULL must already be handled specially. (Then again, giving the problem you have, that might be assuming too much.) OTOH, one needs to know whether the SQL statement is expecting a string literal or a numerical literal to know whether 5 should be 5 or "5". Or maybe 5 will always do, but you still need to special case that.