Hello,
   I am having a small problem with inserting a date into a table. I'm
working on an accounting app, and I have to insert the due date into a
table, which is 30 days in the future.

   I try the following:
      my $sthCreateOEHeader = 
         $dbConn->prepare('INSERT INTO thistab (date) VALUES (?);
      ...snip...
      $sthCreateOEHeader->execute('now()');

   This works, great. Now if I do this:
      $sthCreateOEHeader->execute('now() + 30');

   it carps out with:
      DBD::Pg::st execute failed: ERROR:  Bad date external representation
'now() + 30'...

   Any idea how I could do this. I'd rather not have to create the date in
my program, since Postgres can do this for me. BTW, when I do this under
psql, there is no problem.

   I'm using Perl 5.8, Postgres 7.2, DBI 1.30, DBD::Pg 1.13.

J-T MacNeil
Jr. Software Developer, Connect 24 Division
Digital Security Controls
Phone: (905) 760-3000 x7302
e-Mail: [EMAIL PROTECTED]

Reply via email to