in reply to Class::DBI / Oracle date field Q
It tries to set the date column to the string "to_date( '03/03/2004', 'MM/DD/YYYY' )" and fails.update tablename set foo = 'bar', date = 'to_date( \'03/03/2004\', \'MM/DD/YYYY\' )' where id = '1'
You'll have to do any date calculations & conversions yourself and pass in the result using whatever format Oracle recognizes (unix epoch? YYYYMMDDHHMMSS format?). Or maybe even use attribute inflation/deflation to make your life a little easier. Just pass in (for instance) a Time::Piece object instead of a date string. There's even an example of this using Time::Piece in Class::DBI's POD.
Bottom line: For safety reasons, anything you set your Class::DBI objects' fields to will never be interperted as SQL. Otherwise, its queries would fail every time you did something involving quotation marks.
blokhead
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Class::DBI / Oracle date field Q
by freddo411 (Chaplain) on May 07, 2004 at 22:13 UTC | |
|
Re: Re: Class::DBI / Oracle date field Q
by AZPhantom (Initiate) on May 08, 2004 at 00:20 UTC |