LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using the database connectivity toolkit to retrieve data using a SQL query. The database has 1 million records, I am retrieving 4000 records from the database and the results are taking too long to get, is there any way of speeding it up?

I am using the "fetch all" vi to do this, but it is retrieving one record at a time, (if you examine the block diagram) How can i retrieve all records in a faster more efficient manner?
0 Kudos
Message 1 of 7
(3,679 Views)
Use the example called Read All Data; it's described in the readme document and uses a slightly different process to return the data. In older versions of LabVIEW there were some problems with NULL values, but as of LabVIEW 7.x, it works fine with any type of data.
0 Kudos
Message 2 of 7
(3,678 Views)
Thanks for the quick response. I was unable to find the example, searched on "read all data" and couldn't find that example. Couldn't find the "readme" file either... 😞 Anyone else have a suggestion?
Need some help on this one!

Thanks
0 Kudos
Message 3 of 7
(3,678 Views)
found the example that you listed. It uses the "list" vi to list the columns and then retrieves all the data. This would take days to retrieve a million records and then sort through the data for my 4000 records. This would be much worse than how i am doing it now...
0 Kudos
Message 4 of 7
(3,678 Views)
If this isn't faster than your previous method, then I think you found the wrong example. If you have the Database Connectivity Toolkit installed, then go to the LabVIEW Help menu and select "Find Examples". It defaults to searching for tasks, so open the "Communicating with External Applications" and "Databases" and open the Read All Data. The List Column names just gives the correct header to the resulting table and is a fast operation. That's not what you are supposed to be looking at ... it's the DBTools Select All Data subVI that is the important one. If you open it and look at its diagram, you'll see that it uses a completely different set of ADO methods and properties to retrieve all the data.
0 Kudos
Message 5 of 7
(3,678 Views)

Hi jimbo,

Crystal made a very good comment in suggesting the Read All Data.vi shipping example. 

Good luck!

Kileen C.
Applications Engineer
National Instruments

0 Kudos
Message 6 of 7
(3,678 Views)
Yes, Crystal gave excellent advise, Hats off to Crystal, you saved me a lot of time, wish I could send you a box of chocolates 🙂

Thanks for your input Kileen, I will take a look at the KB you posted!

Thanks!
0 Kudos
Message 7 of 7
(3,678 Views)