Forum Discussion

jeetendrae's avatar
jeetendrae
New Contributor
8 years ago

call Procedure having output parameters in JDBC Test Step not showing value of output variable

Hi All,


I have created a Stored Procedure with Output parameter, which gives me the result set in MySQL successfully,
But when I try to call same procedure using JDBC Test Step in SoapUI, I am not able to retrieve the result set.


I have provided proper syntax to call Stored Procedure for the same.

 

In MySQL I have created stored procedure named: getActors which I am calling properly from JDBC request as follows:

 

{call getActors(@cgetActorsnt)}

 

Also, selected checkbox "Select if this is a stored procedure"

 

When I hit this stored procedure from My SQL server database then got proper result as below:

 

Result#1 (1*1)
@cnt
200

 

But if same I am calling in SoapUI as: {call getActors(@cgetActorsnt)}, I got result without 200:

 

<Results>
<ResultSet fetchSize="0">
<Row rowNumber="1">
<_Cnt/>
</Row>
</ResultSet>
</Results>

 

SoapUI log:
INFO:{call getActors(@cgetActorsnt)}
INFO:Got response for [MySQL] in 3ms (131 bytes)

 

Expected: @Cnt should display 200 instead of null.

 

Please help here.

  • Thank You !!!

     

    Yes. JDBC TestStep doesn't have a way to get the output variable, so I have to used Groovy Script here.

     

    Once I called stored procedure with: {call getActors(@cgetActorsnt)} then I have added one more step to get value of output variable from the called store procedure as below:

     

    // To get the value of output variable from the called store procedure
    def valueOfOutputVariable = con.rows("select(@cnt)")

     

    valueOfOutputVariable displayed the count as 200 which is expected and matching as per the database query.

  • jeetendrae's avatar
    jeetendrae
    New Contributor

    Thank You !!!

     

    Yes. JDBC TestStep doesn't have a way to get the output variable, so I have to used Groovy Script here.

     

    Once I called stored procedure with: {call getActors(@cgetActorsnt)} then I have added one more step to get value of output variable from the called store procedure as below:

     

    // To get the value of output variable from the called store procedure
    def valueOfOutputVariable = con.rows("select(@cnt)")

     

    valueOfOutputVariable displayed the count as 200 which is expected and matching as per the database query.