freddo411 has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Class::DBI and I'm trying to update a field in my Oracle DB that is of "Date" type. My routines has been working well for numbers and strings but I'm having some difficult with the date datatype.
In the past, when I was just using DBI I would use some SQL like:
update tablename set foo = 'bar', date = to_date( '03/03/2004', 'MM/DD/YYYY' ) where id = '1'
With Class::DBI I've been passing a hash into it where the hash has column/value pairs.
# Do the DB insert $dn_entry->set( %dn_out ); $dn_entry->update; $dn_entry->dbi_commit();
I tried filling my hash with the same to_date function call string like above and I got this error....
DB error: Can't update 50025: DBD::Oracle:: st execute failed: ORA-01858: a non-numeric character was found where +a numeric was expected (DBD ERROR: OCIStmtExecute) [for statement ``UPDATE Domai +nNames SET domainname = ?, expire_date = ?, dn_id = ? WHERE dn_id=? + '']) at ../Modules/site_perl/5.005/Ima/DBI.pm line 720.
Any ideas how to use Class::DBI and oracle together to set date field values?
Cheers
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Class::DBI / Oracle date field Q
by blokhead (Monsignor) on May 07, 2004 at 00:06 UTC | |
by freddo411 (Chaplain) on May 07, 2004 at 22:13 UTC | |
by AZPhantom (Initiate) on May 08, 2004 at 00:20 UTC | |
|
Re: Class::DBI / Oracle date field Q
by pelagic (Priest) on May 07, 2004 at 06:30 UTC | |
by Anonymous Monk on May 07, 2004 at 08:07 UTC | |
by dba (Monk) on May 07, 2004 at 18:27 UTC |