LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2013 Database Toolkit Create Parameterized Query Postgres Bug

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.

0 Kudos
Message 1 of 9
(4,533 Views)

Hi, there is not yet a 2013 Database Toolkit available.  Are you referring to using the 2012 toolkit with LabVIEW 2012 SP1?

Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(4,506 Views)

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 2011

 

Labview 2012

2012.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 3 of 9
(4,471 Views)

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.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 9
(4,467 Views)

Looks like the bug ID mentioned above is related to this issue and is still being addressed by our developers.

Applications Engineer
National Instruments
0 Kudos
Message 5 of 9
(4,445 Views)

We've just encountered this issue in 2016.  We lost an entire day due to it.

 

I wonder why it hasn't been resolved....

0 Kudos
Message 6 of 9
(4,027 Views)

Did you encounter this issue in LabVIEW 2016, or are you experiencing this issue in the version mentioned in the earlier posts? 

0 Kudos
Message 7 of 9
(4,005 Views)

Encountered in 2016.  Seriously not good, deadline missed because of it.

0 Kudos
Message 8 of 9
(3,997 Views)

pfffttt. not fixed in 2021.  Then again, I doubt they have updated the toolkit despite more and more datatypes for databases. 


Paul
0 Kudos
Message 9 of 9
(1,880 Views)