Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Dates in OCI
May,
It's true. ODBC was designed to support more RDBMSes. Some of them (e.g.:
DB2/400) support
DATE (only) and TIME (only) along with (datetime) TIMESTAMP.
When you use SQL_DATE (instead of SQL_TIMESTAMP) driver will ensure proper
conversion -
in direction ORACLE -> Client it will fill your DATE_STRUCT variable. In
opposite direction
(Client -> ORACLE) driver stuffs something to ORACLE column. The time
portion is zero and the date portion
(for SQL_TIME) is something - you can look what it is, using Thomas Kyte's
suggestion.
What about the OCI - it was designed only for ORACLE. The proper C datatype
is OCIDate.
However you can get TIME (only) and/or DATE (only) portion. See
::OCIDateGetDate/::OCIDateGetTime
functions.
IMO, the main problem was how to find out what is actually stored in a DATE
column. Your application
is unable to decide whether the TIME or DATE portion is valid or it is just
a stuffing when she receives
SQL_TIMESTAMP or SQLT_ODT. Unless this information is stored somewhere or
the application
can do some statistics...
BTW: I BEG you, PLEASE DON'T INCLUDE my e-mail ADDRESS in your replies to
prevent
my box from being bombed by spambots. Or make it unreadable for spambots at
least.
--
Thank you for keeping >anti-spam< habit:
not including my address in your reply.
Received on Tue Sep 21 1999 - 02:45:44 CDT
![]() |
![]() |