On 2006-10-18 10:19:24 -0400, Hardy Merrill wrote: > I think I get it yes. So here is what I am doing. Access has a date > field that I am pulling out and when I print the "$start_date" variable > > it looks like this: > > 2006-09-15 00:00:00 > > That is a string now to Perl...correct? Now I am inserted that string > into the Oracle database as a DATE. So I am doing, using the variable > from the bindcolumn parameter: > > TO_DATE($start_date, 'MM/DD/YYYY') > > to insert that string into Oracle as a DATE and passing in the date > format along with it.
The date format is wrong. If you tell Oracle to expect a date in
MM/DD/YYYY format and then feed it a string like '2006-09-15 00:00:00'
it will complain that they don't match. You will eitther have to change
the format string to match the actual date format (i.e., 'YYYY-MM-DD
HH24:MI:SS') or change the date format to match the format string.
Also, TO_DATE($start_date, 'MM/DD/YYYY') will almost certainly result in
a syntax error. That expands into something like
TO_DATE(2006-09-15 00:00:00, 'MM/DD/YYYY')
which is not not correct SQL (the quotes are missing). Use placeholders.
Finally, you might want to look at the execute_array method. For recent
versions of DBD::Oracle is a lot faster then execute for bulk inserts.
hp
--
_ | Peter J. Holzer | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR | I'd be programming in Java.
| | | [EMAIL PROTECTED] | I don't, and I'm not.
__/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users
pgpdBTsDNumGv.pgp
Description: PGP signature
