This external stored procedure does not return a result set when I call it

Database
Fan

This external stored procedure does not return a result set when I call it

The execution was successful on Teradata server, however when I call this procedure, it returns no result. 

 

public class TryCCLR2 extends MyConnectionProvider {
static Connection clm = MyConnectionProvider.getCon();
static CallableStatement cStmt;
final static String GeCts = "select top 10 ID from db.atls a where Vab = ?;";

public static void tryCCLR(String pp, ResultSet[] answer1)
throws ClassNotFoundException, SQLException {
cStmt = clm.prepareCall(GeCts);
cStmt.setString(1, pp);
boolean hasResults = cStmt.execute();
if (hasResults) {
ResultSet rs = cStmt.getResultSet();
answer1[0] = rs;
}
}

}

 


REPLACE PROCEDURE "CallSP2" (
IN "pp" VARCHAR(256))
LANGUAGE JAVA
READS SQL DATA
PARAMETER STYLE JAVA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'jarIdTryCCLR3:jxsp.TryCCLR2.tryCCLR(java.lang.String)';

Tags (2)
2 REPLIES
Teradata Employee

Re: This external stored procedure does not return a result set when I call it

Since the statement is a SELECT, try using prepareStatement instead of prepareCall.

Fan

Re: This external stored procedure does not return a result set when I call it

Thanks, that still didn't work. I call it just like a regular stored procedure 

call callsp2('NAB');

Still it doesn't return a result set