NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Call stored procedure in mySQL

Hi,

 

I am trying to call a stored procedure in mySQL from TestStand 2010 using the dedicated steps "Open SQL Statement", "Data Operation: Execute Procedure", "Data Operation: Close Procedure". The SQL procedure has 2 arguments: 1 varchar(45) IN, 1 varchar(45) OUT. The problem is that the variables transmission from TestStand to the server and from the server to TestStand are not working, that is to say argument 1 is set to "myString" by TestStand and the server is receiving NULL, and argument is set to "MyString" by the server and TestStand is receiving NULL.

If anyone can help the following information might be helpful:

- The SQL statment I am using in TestStand is "call test_results.GetChrono(@TableName, @Chrono)"

- The procedure protoype in SQL is "PROCEDURE `Get_Table_Chrono`(IN TableName VARCHAR(45), OUT Chrono VARCHAR(45))"

There is no error message during the execution, just the "Chrono" data received by TestStand is NULL even if for sure the server is not sending NULL.

 

Many thanks for your help!

 

Greg.

 

 

0 Kudos
Message 1 of 5
(4,966 Views)

This is perhaps overly basic, but are you sure the machine you're running TestStand on can connect to the MySQL server? Using a command-line or GUI client to manually call your SP will isolate the issue to within TestStand.

0 Kudos
Message 2 of 5
(4,963 Views)

Thank you for your answer. I tried to call the procedure on the machine TestStand is running on, but with mySQL workbench (using the same connexion parameters) and it is working fine. Moreover if I update a record in the procedure I can see it is updated when I cal the procedure from TestStand, si I think the problem is really concerning only parameters passing. Has someone ever tried to cal a procedure on a mySQL server with IN and OUT parameters?

0 Kudos
Message 3 of 5
(4,956 Views)

There is an example of using databases in TestStand in the Examples folder under the Databases folder. However, it uses a local Access database, not a MySQL server. It may be helpful to look at anyway.

0 Kudos
Message 4 of 5
(4,949 Views)

Hi,

 

I am afraid there is nothing about calling stored procedures in the examples. In fact I am not a beginner with databases and TestStand, I know how to query, set and get data, my only problem is really calling procedures.

 

Greg.

0 Kudos
Message 5 of 5
(4,940 Views)