OCI Insert - Date Field Problem

From: Stan Newby <siclaro_at_dfw.net>
Date: Fri, 22 May 1998 20:36:21 -0500
Message-ID: <35662815.4ED2_at_dfw.net>



Hi:

[Quoted] I'm writing a C program using OCI to update data in Oracle 7.3. I'm attempting to insert a row with a date field. I am using obndrn to bind a null terminated string containing the date before the oexec. The problem is that the date I'm trying to insert is in the format ' 'MM/DD/YYYY HH24:MI:SS' and our instance default is something like DD-MON-YY, so I get a "ORA-1483 error - not a valid month". If I change the date I'm inserting to the DD-MON-YY default format the insert works, but is not what I want because I loose the time components. I can't get our DBAs to change the default format neither.

Is there some way I can use the TO_DATE function to get around this problem?
If so, how would I use it? During the bind? (i.e. If :3 was the date field
then ..."insert into table values (:1, :2, TO_DATE(:3,'DateMask')) ").

Any suggestions are appreciated.

Stan Newby
EDS-TESCA
siclaro _at_ dfw _dot_ net Received on Sat May 23 1998 - 03:36:21 CEST

Original text of this message