timestamp problems

Mark R

Member
I am having problems accessing timestamp fields with certain values and I cannot use the TOracleSession->Preferences->TimestampAsString=true to solve it as it will cause problems in other areas of the program that must access the columns with AsDateTime.

I am using Oracle 11gR2 and DOA 4.1.1.0 on BCB 6.

I am getting a "time encode error" when selecting records with with a timestamp values with milliseconds of .999500 or above from what I can tell.

Statements to reproduce:

create table timestamp_test (log_date timestamp with local time zone);
insert into timestamp_test (log_date) values ('06-NOV-2012 02:26:40.999874');
commit;

Using a TOracleQuery:
select to_char(log_date) from timestamp_test

TO_CHAR(LOG_DATE)
-------------------------------
06-NOV-12 02.26.40.999874 AM

select log_date from timestamp_test

LOG_DATE
--------
 
It works fine for me. I tested on an Oracle 11.2.0.1 Client and an Oracle 11.2.0.1 Server.

Do you have the source code option? If so, we can trace into the timestamp decoding and date encoding functions to see what goes wrong. If it turns out that the timestamp data returned to the client is incorrect, there will be little we can do of course.

Alternatively you can use use the to_char function for this specific dataset to work around the issue.
 
Back
Top