LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

oracle datatype "timestamp"

Hi,
 
does anybody know how to handle the oracle "timestamp"-datatype in LabView.
 
I connect to the database by the "microsoft OLE DB Provider for Oracle". This one does not support this datatype. So I'm going to change to the oracle OLE-driver.
 
 
Lorand
0 Kudos
Message 1 of 5
(3,555 Views)

Hi Lorand,

      This may be a "long-shot", but if the Oracle "timestamp" is the same format as the 8-byte "datetime" used in MS Access, and MS SQL, then it can be converted into a float meaning days-since Jan 1, 1900.  The "trick" may be in reading the raw timestamp as a float...

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 5
(3,534 Views)
Hi tbd,

thanks for your reply. The oracle timestamp-format is not similar to the access-type. The oracle format includes also date and time, but with a resolution of "1ns".
I tried to connect with the oracle oo4o ole-interface, using the LV activeX-functions, but in most cases LabView (8.5) crashed.
In the next step, I tried "oracle provider for ole db" and, what a surprise, I can read out the timestamp-column an convert into the LabView timestamp-format. I have not tried vice versa yet. But it will work, I suppose.


Lorand
0 Kudos
Message 3 of 5
(3,519 Views)

It sounds like you found a solution - excellent!

Just out of curiosity, I looked on my PC (XP Prof) for Oracle-related AX objects also looked through.NET assemblies - no luck.  If you can build a very simple VI to repeatably crash LV, it might be a nice debugging tool for somebody on the NI-LabVIEW team.  Here's a link to the product suggestion page (they accept attachments).

That's interesting about the higher resolution of the Oracle timestamp.  Found this interesting link on the 11-byte format.

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 5
(3,513 Views)
To access the oracle activeX-objects, you need the "Oracle Objects for OLE (OO4O)" API, downloadable from the oracle website.

http://www.oracle.com/technology/tech/windows/ole/index.html

I don't know why, but after restarting my PC the activeX-connection with oo4o works. The timestamp-column is retrieved as an object-reference on a timestamp-object. But the timestamp-class in the available library only provides a "toDate" method, with 1s resolution.
Maybe there is an other way to retrieve the value with full resolution, but I stopped working on it.

I will use the
"oracle provider for ole db".

Lorand
0 Kudos
Message 5 of 5
(3,505 Views)