Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Dates in OCI
A copy of this was sent to "May Huang" <chacha11_at_jps.net>
(if that email address didn't require changing)
On Fri, 17 Sep 1999 19:18:49 -0700, you wrote:
>
>I know that Oracle stores date/times as 7 bytes (4 for the date and 3 for
>the time). But in ODBC, I think I can call SQLBindParameter() and pass it
>SQL_DATE and a DATE_STRUCTURE or SQL_TIME and a TIME_STRUCTURE, and store
>only the date or time in a column of type DATE. In fact, I'm pretty sure
>I've seen this done before.
>
>But after speaking with some well knowledged people, everybody keeps telling
>me that Oracle stores it as date/time.
>
Oracle doesn't have a TIME only type or a DATE only type. If ODBC lets you bind with a SQL_TIME type -- they must be stuffing some 'magic' date into the date field.
You could use sqlplus to select to_char( datefield, 'dd-mon-yyyy hh24:mi:ss' ) from T to see what magic date they are using to represent a NULL date component of a TIME type.
>
>huh <huhhy_at_rocketmail.com> wrote in message
>news:7rsus3$i7g$2_at_ns.felk.cvut.cz...
>> Edward,
>>
>> I'm afraid, neither ODBC nor OCI gives you the information you want.
>> ORACLE datatype DATE is mapped in ODBC to SQL_TIMESTAMP.
>> Both interfaces can't give you this information, because neither of them
>> have any knowledge what was you db designer's intention when (s)he
>> chose the DATE datatype.
>>
>> --
>> Thank you for keeping >anti-spam< habit:
>> not including my address in your reply.
>>
>>
>
--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Sat Sep 18 1999 - 08:30:16 CDT
![]() |
![]() |