Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by cees (Curate)
on Dec 04, 2005 at 13:26 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://513947]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2025-02-08 22:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (95 votes). Check out past polls.