LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone have experience with ODBC call to Oracle Database

Set up database connection with no errors, SQL string accepted but no
data returned. Tested locally with Access and worked.
0 Kudos
Message 1 of 3
(3,361 Views)
There are actually 4 different ways you can connect to an Oracle
database from LabVIEW and the Database Connectivity Toolkit:
Microsoft ODBC driver for Oracle
Microsoft OLE DB provider for Oracle
Oracle ODBC driver for Oracle
Oracle OLE DB provider for Oracle

In my experience, the Microsoft drivers aren't as good as the Oracle
ones. In fact, I never could get the Microsoft drivers to return
binary data at all. That might be what you are seeing.

Also in my experience, OLE DB providers are more robust and efficient
than ODBC. However, if ODBC is your only option, then definitely use
the Oracle drivers. You can download them from the Oracle website if
you don't already have them.

I hope this helps,
Crystal
0 Kudos
Message 2 of 3
(3,361 Views)
I am using Labview 7 with the latest version of Oracle (don't know
what it is but it is the latest). I use the Microsoft OLE DB for
Orcle driver. You must use the variant data type to get the value
from Oracle and then convert the variant to whatever type you are
expecting. When I first did this, I discovered that a numeric data
type would not show up in an array of variants. In other words, I did
the SQL query, and my results were returned into an array of variant
type. The array was a front panel indicator. When the returned value
was a numeric, the indicator was blank. Strings would show up fine.
When I converted the numeric variant to a numeric type and displayed
it on a front panel indicator, the data showed up perfectly. So if
the data type you
are trying to retrieve is numeric, convert it from
variant to numeric and it should now be there. This must be a bug
between Labview and Oracle. I have attached an example vi for
retrieving Oracle data.
0 Kudos
Message 3 of 3
(3,361 Views)