Click here to subscibe to newsletter

Insert records with date type in a Oracle database


[ Follow Ups ] [ Post Followup ] [ SQL Script Builder Forum ]

Posted by Javier Garnica 200.61.171.189 on July 05 2005 20:10:48:

I am trying to insert records in a Oracle database from an Access Odbc connection that contains fields of date type, and the script generated contains statements like this:

INSERT INTO MF_DOCUMENT VALUES('001168-M','00000001.TIF',
'20','29/05/2003','29/05/2003','1','2','35','864513');

when I run the script Oracle SQL*PLUS console I receive the following error message in every insert statement:

'20','29/05/2003','29/05/2003','1','2','35','864513');
*
ERROR AT line 2:
ORA-01843: not to valid month


And when I try this insert statement by hand with the to_date function it works ok.
INSERT INTO MF_DOCUMENT VALUES('001168-M','00000001.TIF',
'20',to_date('29/05/2003', 'DD/MM/YYYY'),to_date('29/05/2003', 'DD/MM/YYYY'),'1','2','35','864513');

Is there any way to generate the script for Oracle correctly to update the date type fields?



Follow Ups:



Post a Followup

* : (Required)

* Name:
E-Mail:

* Subject:

* Comments:

Optional Link URL:
Link Title:
Optional Image URL:

Enter the code shown :


[ Follow Ups ] [ Post Followup ] [ SQL Script Builder Forum ]

Copyright © 1999-2004 David Birebent All Rights Reserved.