Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> OCI Insert - Date Field Problem

OCI Insert - Date Field Problem

From: Stan Newby <siclaro_at_dfw.net>
Date: Fri, 22 May 1998 20:34:15 -0500
Message-ID: <35662797.7548@dfw.net>


Hi:

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 Fri May 22 1998 - 20:34:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US