Page 1 of 1

Using AsTimeStamp

Posted: Thu 12 Apr 2018 15:27
by jjeffman
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

Re: Using AsTimeStamp

Posted: Wed 18 Apr 2018 15:08
by MaximG
Try using the code below :

Code: Select all

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

Re: Using AsTimeStamp

Posted: Wed 18 Apr 2018 19:38
by jjeffman
Thank you very much for answering me.

This made the trick.

Best regards.

Jayme Jeffman

Re: Using AsTimeStamp

Posted: Thu 19 Apr 2018 05:47
by MaximG
We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning ODAC usage.