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 -> Dates in OCI

Dates in OCI

From: Edward Chan <ballgod_at_yahoo.com>
Date: Fri, 17 Sep 1999 05:10:37 GMT
Message-ID: <7rsig8$j7r$1@nnrp1.deja.com>


I'm writing an OCI application that deals with dates and times. My problem is this: I need to execute a query, that is generated dynamically, so I don't know what the types are for the select list items. But that's not my problem. Getting the type is easy. The problem is when I encounter columns that return SQLT_DAT for the type code. From this type code, I cannot determine whether the column is used for only the time portion, or only the date portion, or both.

In ODBC, there are type codes like SQL_DATE, SQL_TIME, SQL_TIMESTAMP that distinguishes between the different types. Is there something like this for OCI? How would I store just the time, or just the date portions?

If I call OCIDefineByPos() using SQLT_DAT (which was what I determined the column type to be), I will get back all 7 bytes of the date (Oracle stores dates as 7 bytes). But I have no way of determining whether the column stores times, dates, or timestamps (date/time).

In short, how would I store just time, or just date using OCI? And how do I determine what the column stores, just time, or just date? The type code SQLT_DAT doesn't tell me the information I need to know.

Thanks for any suggestions.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Sep 17 1999 - 00:10:37 CDT

Original text of this message

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