LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database Toolkit: SQL comments and semicolons cause errors

I have extensive experience with the current rev of the Database Connectivity Toolset, connecting to Oracle databases from LV. I'd like to report what appear to be two bugs:

 

1. Ending an SQL statement with a semicolon causes an error: -2147217900, Exception occured in Microsoft OLE DB Provider for Oracle: ORA-00911: invalid character.   That is incorrect behavior by anyone's SQL conventions.

 

2. Putting a standard SQL comment, beginning with "--" before the first SQL statement causes an error: -2146824584, Exception occured in ADODB.Recordset: Operation is not allowed when the object is closed.  However, placing the same comment AFTER all sql statements is not an error, and it is also ok to append a comment to a line within an SQL statement.

 

Workarounds are obvious, but this stuff needs attention...

Gary Johnson
0 Kudos
Message 1 of 3
(2,763 Views)

Thanks for the heads-up Gary, I will try to replicate this and file a bug report.  Can you post your code that shows these behaviors in action?


Has anyone else experienced these errors?

0 Kudos
Message 2 of 3
(2,732 Views)

The LV app is pretty basic: Open a connection, call DB Tools Execute Query.vi to send the SQL statement, call DB Tools Fetch Recordset Data.vi to get the data, then DB Tools Free Object.vi, and finally disconnect.  Whether my bug observations hold for any database system other than Oracle, I can't tell you.

 

A script that works:

 

   select sysdate from dual  -- with this trailing comment and no semicolon is ok

 

Scripts that fail:

 

  select sysdate from dual;

 

 

-- this leading comment is an error

select sysdate from dual 

 

-Gary 

Gary Johnson
0 Kudos
Message 3 of 3
(2,727 Views)