04-17-2013 01:02 PM
I have come across a bug using stored procedures in the 2013 Database Toolkit Create Parameterized Query VI. In the 2012 version of the toolkit, when stored procedure is set to true and auto detect parameters is set to false, the command will be passed to the database driver as a stored procedure (correct). New in the 2013 version, if auto detect parameters is set to false and stored procedure is set to true, then the command will be passed as an unknown command (tells the database driver to autodetect what type of command is being passed). When passing a stored procedure name for Postgres ODBC driver, this now fails. I had to revert to using the 2012 version of this VI in order to allow my code to continue working.
I wonder if this is related to bug ID 240787, listed as a bug fix for the 2013 toolkit which fixes "Auto-detecting parameters fails when preparing a stored procedure call in MS SQL Server 2005." If so, this "bug fix" apparently breaks operation with stored procedures in Postgres.
Just thought I would post this as a heads up for anyone else who may come across this, since I googled around and found no mention of this change. Luckily I still had the 2012 version around to pull up and look for differences so spot this bug fairly easily.
04-18-2013 04:40 PM
Hi, there is not yet a 2013 Database Toolkit available. Are you referring to using the 2012 toolkit with LabVIEW 2012 SP1?
05-03-2013 01:41 PM
I find the same thing happening to me, except as Eric states, this is for Labview 2012. Everything works fine in 2011 but after upgrading to 2012, I get an error that a required parameter is not passed. Looking at the code below from "DB Tools Create Parameterized Query.vi", you can see that if auto-detect parameters is false, 2012 sets the CommandType to adCommandUnknown even though StoredProcedure? is set to true. I can change the code back to reflect the 2011 version no problem, but this seems like a bug to me.
Labview 2011
Labview 2012
05-03-2013 02:09 PM
I might add that if i change the query from the stored procedure name to a parameterized query i.e. {call storedProcedure (?)}, everything works fine. This did not work before with both MSSQL and mySQL. Now it seems to work with both. But a parameterized query should not be required to call a stored procedure.
According to the help file:
For stored procedures, set stored procedure to TRUE and SQL query to the name of the procedure you want to execute.
05-06-2013 11:53 AM
Looks like the bug ID mentioned above is related to this issue and is still being addressed by our developers.
02-13-2017 03:40 PM
We've just encountered this issue in 2016. We lost an entire day due to it.
I wonder why it hasn't been resolved....
02-14-2017 04:25 PM
Did you encounter this issue in LabVIEW 2016, or are you experiencing this issue in the version mentioned in the earlier posts?
02-14-2017 04:47 PM
Encountered in 2016. Seriously not good, deadline missed because of it.
08-26-2021 05:53 AM
pfffttt. not fixed in 2021. Then again, I doubt they have updated the toolkit despite more and more datatypes for databases.