Skip to main content

Good morning!

I need to call a stored procedure of DB2 from FME. If I use the IBM Data Studio this script works fine:

CALL TESTING.TEST_PROCEDURE('input1','input2',?,?,?,?,?);

It has 2 input parameters and 5 output parameters.

But when I use the same script in the SQLCreator of FME i always get this error:

 

Literal replacement parsing failed for procedure call to DB2 for z/OS. Failing SQL text {my_script}. ERRORCODE=-4463, SQLSTATE=42601

 

Does anyone have any experience calling DB2 stored procedures in FME? Any help would be appreciated.

I'm using FME 2021.1.

 

The SQLCreator / SQLExecutor does not support bind variables (signaled by the question marks), so you'll have to reference the dynamic parameters using the @Value(name) function. For example, given the FME attributes named "foo", "bar" and "baz":

CALL TESTING.TEST_PROCEDURE('input1','input2',@Value(foo),@Value(bar),@Value(baz));

Notice the upper case V in @Value().


The SQLCreator / SQLExecutor does not support bind variables (signaled by the question marks), so you'll have to reference the dynamic parameters using the @Value(name) function. For example, given the FME attributes named "foo", "bar" and "baz":

CALL TESTING.TEST_PROCEDURE('input1','input2',@Value(foo),@Value(bar),@Value(baz));

Notice the upper case V in @Value().

But those are the Output parameters. They have to be included in the call, but they don't have value.

 

Maybe this kind of procedures can't be called from FME.


But those are the Output parameters. They have to be included in the call, but they don't have value.

 

Maybe this kind of procedures can't be called from FME.

Thanks, that wasn't clear to me. In that case you'll probably have to wrap the procedure call into something that returns a table-like object, similar to a SELECT statement.

This was the first result I found on Google, but I can't judge if it's relevant in your case or not: https://www.ibm.com/docs/en/db2/11.5?topic=functions-invoking-user-defined-table


But those are the Output parameters. They have to be included in the call, but they don't have value.

 

Maybe this kind of procedures can't be called from FME.

Thanks for your answer.

Yeah, something like that I will have to do. Instead of calling the stored procedure directly, using an intermediary. I'll ask the database manager for possibilities about this.

Thanks again!


Reply