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
In reply to Class::DBI / Oracle date field Q by freddo411
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |