Precompilers and OCI (MOSC)

MOSC Banner

OCI Insert order changes DATE value.

edited Aug 1, 2012 5:57AM in Precompilers and OCI (MOSC) 6 commentsAnswered ✓
Oracle 64bit (11.1.0.6.0, 11.2.0.1.0).  This is my test table:
SQL> desc test_date_float_date;
 Name                                      Null?    Type
 ----------------------------------------- -------- -------------
 TYPE_DATE1                                         DATE
 TYPE_DEC                                           FLOAT(126)
 TYPE_DATE2                                         DATE


OraText *insert   = (OraText *) "INSERT INTO test_date_float_date(type_date1, type_dec, type_date2) VALUES (:ph1, :ph2, :ph3)";

   bRc = checkerr(errhp,
         OCIDateTimeConstruct(envhp, errhp, v_datetime,
                              (sb2)2012, (ub1)7, (ub1)19, (ub1)0, (ub1)0, (ub1)0, (ub4)0,
                              (OraText *) timezone, 5));
   bRc = checkerr(errhp,
         OCIDateTimeConstruct(envhp, errhp, v_datetime2,
                              (sb2)2012, (ub1)7, (ub1)19, (ub1)0, (ub1)0, (ub1)0, (ub4)0,
                              (OraText *) timezone, 5));
NOTE:
I am working on another post about what is the correct value for time (h,m,s,f) to set to OCIDateTime for DATE (OCI_DTYPE_DATE).  Using different time value doesn't change the outcome of test cases.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center