in reply to DBI quoting when I don't want it to

How about just always binding that value as a parameter? So your SQL would look like:

INSERT INTO table (thisdate) VALUES (?) WHERE id =1

Then store either a yyyy-mm-dd date string or the format which calls the function in a variable, say $theDate.

Then, always just:

$sth->bind_param(1, $theDate);

... and you don't have to worry about whether to quote or not.
  • Comment on Re: DBI quoting when I don't want it to

Replies are listed 'Best First'.
Re: Re: DBI quoting when I don't want it to
by lachoy (Parson) on Aug 21, 2002 at 15:18 UTC

    Does this actually work? I'd be mildly surprised if it did, since you're asking the database to pull commands out of what is being bound as a string (or precisely, SQL_VARCHAR). This sort of thing is better done at the application level, since it alone knows what type of value is being inserted.

    Chris
    M-x auto-bs-mode