07-15-2015 05:50 AM
*****WARNING***** I am still trying to learn Labview as much as I can through the tutorials and various other modules. So my coding may still not be extrememly as effecient as it should be. *****WARNING*****
First off, I am using Labview 2014. My question is, can I execute multiple Stored Procedures with the SQL VI that I am using? If not, how can I do so? I am doing the following steps:
1. Connect
2. Login
3. Execute one Stored Procedure
4. Get the Data String
5. Close connections.
I am doing this cycle about 25-30 times, every 2-3 minutes. The Stored Procedures take about 30-60 seconds to execute. I was wondering if I could do the following steps instead:
1. Connect
2. Login
3. Execute all of the Stored procedures
4. Get all of the Data Strings
5. Close connections.
If not, can you advise if there is a better way to do this?
A picture of what I am currently working with is attached...
Thanks Greatly...
Solved! Go to Solution.
07-15-2015 06:58 AM
We'd like to help you. One way to do that is to run your code, but you only sent us a picture of your code. Many of us do not have time to recreate your code from a picture!
Please attach the VI itself, so we can open it, examine it, find/fix errrors (if there is a broken Run arrow, for example), etc. Help us to help you. Note that if you need to, you can attach a ZIP file with several VIs inside.
Bob Schor
07-15-2015 08:17 AM
The problem is, I have to remove all server information because I am connecting to a corperate Server connection, before I send the VI. "Network security policies" That is why I only sent a picture. Would it be help still to send the VI without the Server information?
There is a sample VI. I have no errors with this setup, "BUT" that's only running 1 Stored Procedure. Can I take that setup and run multiple Stored Procedures with it??
Please advise...
07-15-2015 08:53 AM
07-15-2015 09:02 AM
The Stored procedures don't change, I have to run the same 20-30 stored procedures every 2 minutes. How can I do that with 1 login, connect and close?
Please advise
07-15-2015 09:06 AM
07-15-2015 09:25 AM
Only thing is, this VI runs 24/7
07-15-2015 09:36 AM
07-15-2015 09:39 AM
@Dennis_Knutson wrote:
Move your connect and login out of the case statement. Do it in your main and pass the reference to the subVI. If you are using a state machine, the connection/login would be a state called at the beginning and then you would have a close state when..........
This was the crux of Dennis' suggestion. You can have the close state run whenever you need it, you don't need it to run only when the VI stops.
07-15-2015 09:53 AM
I understood that, I was just making sure that I was on the same page. I am already looking to code it into the 2 minute refresh cycle. It has been running 20+ connection, login and close cycles every 2 min for almost 2 months now. All of a sudden our DBA's decided to pitch a fit about it. So I figured I could do that 1 close action every 2 minutes, they should be satisfied.