OL Learn

Problems with executing stored procedures with DB2

Hello,

we are trying to execute stored procedures on our DB2 with Planet Press Connect Workflow / Planet Press Connect.
The stored procedure is very easy, it only returns the sum of two values.

If I execute the procedure direct with the System I Navigator, the result is correct.

With the script in the datamapper:
resultSet = sqlConnection.createStatement().executeQuery(“CALL XYZ.SP_SUM_NUMS_TST(35,35)”);

an error occurs: SQLException: No ResultSet was produced.
Normal SQL-selections are working without problems.

What can we do to solve this problem?

Many thanks,

NBecker

You could check that the user under which the stored procedure is called from Connect has indeed rights to do so.

The connection is established with:
var sqlConnection = db.connect(conn,‘user’,‘passwd’)

The user has the correct rights to execute the procedure.

I am no DB expert, but my guess is that the stored procedure doesn’t return a query result, as executeQuery() is expecting. If you could modify it to return a query result, even an empty one, it would satisfy executeQuery() and the call would end up successful.

Im Co-Writer with NBecker: Where can we find a Documentation of the used JavaScript Object, in order to modify it?

As Planet Press uses JDBC:ODBC to an IBM DB2, we have to know exactly.

I am used to JavaScript basically but I cant find much Documentation for a JS Connection to a Database…I think its because thats not a really clever solution …

Does it work if you use .execute() instead of .executeQuery()?

I can call a procedure without a return value, that is no problem.
But how do I call / handle a procedure which has a return value?