Returning output parameters from a jdbcSP call to a stored procedure.

Highlighted
One Star

Returning output parameters from a jdbcSP call to a stored procedure.

I am able to retrieve stored procedure outputs using a tJavaFlex widget.   
java.sql.Connection connection_tJDBCSP_1 = (java.sql.Connection) globalMap.get("conn_tJDBCConnection_1");
String sql = "call WEB_ORDER_2020(?,?,?,?)";
java.sql.CallableStatement stmt = connection_tJDBCSP_1.prepareCall( sql );
stmt.registerOutParameter(1, -1);
stmt.registerOutParameter(2, -1);
stmt.registerOutParameter(3, -1);
stmt.registerOutParameter(4, -1);
java.sql.ResultSet rs = stmt.executeQuery();

System.out.println( "WEB_ORDER_2020 returns : " + stmt.getString( 1) + stmt.getString( 2) + stmt.getString( 3) + stmt.getString( 4));
rs.close();
stmt.close();

However when I use the tJDBCSP widget and look at the generated code, I don't see the registerOutParameter 
statements between the PrepareCall and the executeQuery.   And I cannot examine the returned values.
Any help would be appreciated.
Highlighted
Community Manager

Re: Returning output parameters from a jdbcSP call to a stored procedure.

Hi 
You need to define the columns on the schema of tJDBCSP, and select columns as out type in the Parameters table.
BR
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog