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

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.
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 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download