Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

by Tardis (Pilgrim)
on Aug 22, 2002 at 05:58 UTC ( #191939=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 can tell you that Date::Manip is great, but is also one of the two or three biggest modules on CPAN, if memory matters. As for quoting, maybe DATE_ADD will solve it for you?
It's the outer quotes that hurt, not so much the inner ones. I simply can't do this unless I stop using placeholders. So I need DBI to do:

INSERT INTO table (thisdate) VALUES (DATE(NOW() - INTERVAL '+1 month'));

Rather than:

INSERT INTO table (thisdate) VALUES ('DATE(NOW() - INTERVAL '+1 month')');

At least I think that's what you are hinting at being the problem that DATE_ADD might fix.

Not to mention that (AFAIK) DATE_ADD is a MySQL-specific function (I use Pg).

By the way regarding list values, why the "world of pain"?
Because before they came into the picture, the world was a simpler place. I assign arbitary attributes to arbitary table columns. The unique id for each row was the object id.

Suddenly this doesn't work for list values.

My approach has been to break any list values into a seperate table of it's own, with a non-unique key.

When you consider that in a CGI object, anything can have a list value, you can see my pain. In my new backend world I'll be putting my foot down (hard) and deciding which ones can be lists and which ones can't.

Migration is going to be ..... fun

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

Replies are listed 'Best First'.
Re: Re: Re: DBI quoting when I don't want it to
by mattr (Curate) on Aug 22, 2002 at 06:29 UTC
    Ah. Tres harsh. I can see your pain.

    Override dbh->quote() mentioned in pod? Stop using placeholders? (eek)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://191939]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2018-07-19 15:56 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (411 votes). Check out past polls.