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

Home -> Community -> Usenet -> c.d.o.server -> Re: Dates in OCI

Re: Dates in OCI

From: huh <huhhy_at_rocketmail.com>
Date: Tue, 21 Sep 1999 09:45:44 +0200
Message-ID: <7s7d3m$31h3$1@ns.felk.cvut.cz>


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

Original text of this message

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