Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: OT: Postgres, now(), and bindvars

by cees (Curate)
on Dec 04, 2005 at 13:26 UTC ( #513947=note: print w/replies, xml ) Need Help??


in reply to OT: Postgres, now(), and bindvars

You can't put a ? inside a quoted string in your SQL statement as DBI won't see it as a placeholder, but as a simple string. I just pulled the following out of some existing code I wrote a while ago, so I know it works:

INSERT INTO eventdates (eventdate, event, date) VALUES (?, ?, ?::timestamp + ?::interval)

So what you need to do is add the ' minutes' part to a perl variable and pass that entire string to the placeholder.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://513947]
help
Chatterbox?
vrk takes a cookie from the platter on the sideboard.
Eily thinks vrk is a cookie monster
talexb thinks the term 'cookie monster' is unnecessarily drogatory ;) and takes a cookie as well. Mmmm. Delicious cookies.
[davido]: A tool as pretentious as Test::Perl::Critic ought not fail to install because one of its dependencies failed to pull in List::MoreUtils.
[davido]: ...and Clone.pm

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2017-04-25 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (458 votes). Check out past polls.