Using AsTimeStamp

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jjeffman
Posts: 55
Joined: Tue 09 Nov 2004 12:22
Location: Porto Alegre-Rio Grande do Sul - Brazil

Using AsTimeStamp

Post by jjeffman » Thu 12 Apr 2018 15:27

Hello,

I am using ODAC 9.7.26 on C++Builder 6.0 Professional Edition.

When I run a query on a table which has columns defined as TimeStamp(3) on SQLDeveloper those columns are shown with decimal values after the seconds, although the TField::AsDateTime property round the timestamp value to seconds.

I saw there is a AsTimeStamp property implemented by ODAC on version 9.5, but I am getting compiling errors when using TField::FieldByName("XXXX")->AsTimeStamp. How should I use it ?

Thank you very much.

Best regards.

Jayme Jeffman

MaximG
Devart Team
Posts: 892
Joined: Mon 06 Jul 2015 11:34

Re: Using AsTimeStamp

Post by MaximG » Wed 18 Apr 2018 15:08

Try using the code below :

Code: Select all

  TOraTimeStamp *XXXXValue;
  XXXXValue = ((TOraTimeStampField *) (OraQuery->FieldByName("XXXX"))) -> AsTimeStamp;

jjeffman
Posts: 55
Joined: Tue 09 Nov 2004 12:22
Location: Porto Alegre-Rio Grande do Sul - Brazil

Re: Using AsTimeStamp

Post by jjeffman » Wed 18 Apr 2018 19:38

Thank you very much for answering me.

This made the trick.

Best regards.

Jayme Jeffman

MaximG
Devart Team
Posts: 892
Joined: Mon 06 Jul 2015 11:34

Re: Using AsTimeStamp

Post by MaximG » Thu 19 Apr 2018 05:47

We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning ODAC usage.

Post Reply