From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stored Procedure

Solved!
Go to solution

I am having trouble using stored procedures and need some guidance.  

 

If I try to run the stored procedure code I get an error saying I am not providing a required input, but from the LabVIEW it looks like I am providing it.

 

ParamatizedCode.png

 

But I keep getting this error.

 

ParamatizedError.PNG

 

The database table looks as follows:

 

database setup.png

 

@ID is generated in the procedure, it is looked up and inserted.  

 

I do not have any ability to get into the database myself.  This is a stored procedure writtin by my IT department's DB engineer.  The above image has the required feilds highlighted in yellow that I needed to provide when my code runs.  

 

Can anyone see where my mistake has been made?

Thanks for the feedback.

Ben

0 Kudos
Message 1 of 5
(2,627 Views)
Solution
Accepted by topic author BenBabb

The procedure isn't going to match up the parameter names with the values you provide.  You only provide 5 params but there are 8 in the stored procedure.  In your case, SerialNumber will be passed into ID, PartNumber into SerialNumber, etc.  Add some blank params in your cluster if they aren't required.

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

Actually what i said may not be entirely true.  It depends on the definition of the SP itself.  Your picture just shows a list of the parameters but not necessarily in the same order as defined by the SP.

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 3 of 5
(2,577 Views)

Aputman,

Thank you very much.  That is exactly what I needed.  I guess I was confused because my IT Database manager said those values were not required, but LabVIEW must require them.  I put all of the paramaters in and just updated the ones I needed to.  This solved my issues.

Cheers,

Ben

 

fixedParamCode.png

Message 4 of 5
(2,531 Views)

FYI, this is the way that i like to create my parameters.  Hope it helps.

 

database.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 5 of 5
(2,520 Views)