I am executing following code:
simpleJdbcCall.withSchemaName("SCHEMA_NAME")
.withProcedureName(storedProcdure)
.addDeclaredParameter( new SqlParameter("INPUT_PARAMS",Types.LONGNVARCHAR));
// Creating String of input numbers
if (!loanNumbers.isEmpty()) {
for (String str : paramsList)
finalInput = finalInput + str + ";";
finalInput = finalInput + "'";
}
// Preparing map of input params for Stored Procedure
inputParams.put("INPUT_PARAMS", finalInput);
log.info("Input params for Stored Procedure :"+finalInput);
//Input Prepared and finally calling Stored Procedure
SqlParameterSource in = new MapSqlParameterSource(inputParams);
Map<String, Object> resultSet= simpleJdbcCall.execute(in);
If FinalInput have only one value ie. '123467', SimpleJdbcCall will omit this first parameters and I will not get any result. If I run the same SP in any IDE , for the same param , I will get the result.
If it have more than two parameters i.e '123467;98768', it will omit the first parameters(123467) and give result for 98768.
What is the reason for this kind of behavior and how can we fix this.