DevTest JDBC step with DB stored procedure call fails with: Missing IN or OUT parameter
search cancel

DevTest JDBC step with DB stored procedure call fails with: Missing IN or OUT parameter

book

Article ID: 185571

calendar_today

Updated On:

Products

CA Cloud Test Mobile CA Application Test Service Virtualization

Issue/Introduction

When testing a JDBC step with a database procedure call that contains a ? (question mark) as a parameter, the step fails with the following error: 
java.sql.SQLException: Missing IN or OUT parameter at index:: 2

Environment

Release : 10.x

Component : Service Virtualization

Resolution

For a stored procedure call in the JDBC step, all parameters should be listed in the Parameter panel and not in the SQL Statement itself.
So the syntax in the SQL Statement panel should look like:
call mydbprocedure

Notes regarding the DB procedure syntax:
No begin, end
No braces at the end of the procedure ()
No semicolon
No curly braces

Also 'Return Result Set' should not be ticked.
In a SQL statement like SELECT or INSERT, it is possible to use a question mark.

Additional Information