I need to read and write data out of an Oracle database and am finally starting to see some success. This forum post was my first attempt at connecting to Oracle. https://forums.ni.com/t5/LabVIEW/Performing-a-database-call/td-p/3332420
The next step is to actually get Labview to do some of the tasks that need to be performed. One of our IT guys wrote another procedure in Oracle that I am trying to call (dgeitz.get_catalog). The purpose of this VI is to find out what the product number is if I know a serial number. This procedure has two variables that are passed between Oracle and Labview. The first is the Serial number (GC_SERIALNO). The second value is the product number (CG_CATALOG_NO) and should be sent back from Oracle.
The question is, how do I get the value back out of Oracle?
Here is how the Oracle script works:
1) Labview sends a serial number to Oracle (CG_SERIALNO)
2) Oracle sends email to a user as a test that the serial number was received. This is for testing purposes only.
3) Oracle retrieves the product number (CG_CATALOG_NO)
4) Oracle sends email to a user as a test that the product number was retrieved. This is for testing purposes only.
5) Oracle procedure ends when it sends the parameter back to Labview
When I run the attached VI, I can send serial number values to Oracle. If I send an invalid serial number I get no errors from Oracle, however if I send a valid serial number then I get the following error.
![sql error.JPG sql error.JPG]()
Under both conditions, I get no output of the product number (CG_CATALOG_NO), so the VI fails to perform its task either way. The Oracle procedure was tested by running the script manually in an Oracle command prompt like interface (please excuse my ignorance) and it returned the CG_CATALOG_NO value every time.
The most likely explanation for the error above is that when I send an invalid serial number, then the Oracle script breaks and does not complete as it has no way of dealing with an error condition. Nothing is communicated to Labview and Labview appears to be happy. When I send a valid serial number, then something is returned to Labview and it has no idea what to do with that information.
At this point, I am very stuck and I cannot find any examples on how to deal with this situation. I am including my VI and the SQL statement. Any help is very much appreciated.
Other bits of information that may (or may not) be helpful:
Labview 2015
Oracle 11g