cancel
Showing results for 
Search instead for 
Did you mean: 

Pulling Multiple Store procedures

SOLVED
Highlighted
Solved!

Pulling Multiple Store procedures

Message contains an attachment

*****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...

14 REPLIES 14
Bob_Schor
Knight of NI

Re: Pulling Multiple Store procedures

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

Re: Pulling Multiple Store procedures

Message contains an attachment

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...

Dennis_Knutson
Knight of NI

Re: Pulling Multiple Store procedures

Why are you connecting and logging in each time? I think you have retrieve the data after calling a stored procedure but you can certainly connect and log in once to save time.

Re: Pulling Multiple Store procedures

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

Dennis_Knutson
Knight of NI
Solution

Re: Pulling Multiple Store procedures

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 you stop the VI.

Re: Pulling Multiple Store procedures

Only thing is, this VI runs 24/7

Dennis_Knutson
Knight of NI

Re: Pulling Multiple Store procedures

And your point is what? Why would that change my suggestion?
Verywiseguy
Member

Re: Pulling Multiple Store procedures


@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.

Re: Pulling Multiple Store procedures

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.