Re: ADO request mistery
Date: Fri, 20 Jun 2008 05:03:20 -0700 (PDT)
On Jun 20, 6:32 am, "Wilfrid" <grill..._at_yahoo.com> wrote:
> I am running an application on a client machine (server 2003 sp2) that uses
> the oledb driver to execute ado command (driver ODAC1020221.exe).
> It connects to an oracle server 10.2.0.1.0 installed on a windows server
> 2003R2 SP2. The oracle has nls_language AMERICAN and nls_territory.
> The application is regularly executing an update command. Some of the values
> are dates formatted as DD/MM/YYYY. The application then writes a variant of
> date type.
> Sometimes, oracle returns the error message: ORA-01841: (full) year must be
> between -4713 and +9999, and not be 0
> When i check what data the application has sent i can see:
> 732531;0;20/06/2008 08:46:58;20/06/2008 08:47:00;title;type;19/06/2008
> 00:00:00;69;349;349;0;0;5;;2;1;20/06/2008 08:46:13;
> One of the date is apparently taken as 0 event though the date we send has a
> normal format.
> In oracle 10, the view v$sql does not show the data inserted (only the
> variable of the update command.
> Now, this error started to appear few month ago (after installation of the
> system), on the same day we might have 3 or 4 errors (some requests worked
> some others not). We changed the regional settings of the 2 windows server
> (to US). It stopped for a little while and then re appeared again.
> What I do not understand is why it is working fine for weeks and then the
> errors appears from time to time with no apparent patterns.
> If anyone has an idea, please do not hesitate to share them with me!
> thanks in advance
I see a similar problem with one of the computers in our IT group when
literal values with implicit type conversion are used rather than bind
variables. I have not spent much time tracking down the problem - it
may be a result of using an ODBC connection with ADO, or NOT using
ODBC when using ADO directly against the database. Such a problem is
an excellent excuse to implement the proper method using bind
variables. If, for some reason, you cannot use bind variables, modify
the SQL statement to perform an explicit data type conversion: INSERT
INTO ... TO_DATE('20/06/2008','DD/MM/YYYY') ...
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. Received on Fri Jun 20 2008 - 07:03:20 CDT