abubacker has asked for the wisdom of the Perl Monks concerning the following question:
Dear All,
I was trying to execute the following postgres query using DBI module
select * from timestamp_testing where start = timestamp '2011-06-02 12 +:33:07' ;
but this says an errormy $sth = $dbh->prepare ("SELECT * from timestamp_testing where start + = (timestamp ?) "); if ( $sth->execute("2011-06-02 12:33:07" )){ print Dumper $sth->fetchall_arrayref; } else { print "WRONG QUERY\n" ; }
please help me out !DBD::Pg::st execute failed: ERROR: syntax error at or near "$1" LINE 1: ...ELECT * from timestamp_testing where start = (timestamp $1) + ^ a +t NORMAL_DBI.pl line 63
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Issue in prepare() and execute() in DBI
by salva (Canon) on Jun 02, 2011 at 10:01 UTC | |
|
Re: Issue in prepare() and execute() in DBI
by mje (Curate) on Jun 02, 2011 at 09:42 UTC |