I have a stored procedure call in my java code which uses sybase database as follows:
CallableStatement cstmt=sigmaConnection.prepareCall("{call dbo.sp_insRadEntry(?, ?, ?, ?, ?, ?, ?)}");
cstmt.setString(1,"Nappa");
cstmt.setInt(2,40);
cstmt.setString(3,"Vegeta");
cstmt.setString(4,"Saiyan");
cstmt.setString(7,"Hello");
cstmt.execute();
As you can see i have deliberately not set the 5th and 6th parameter as my stored procedure has default values provided if any values are not passed and in this call call dbo.sp_insRadEntry(?, ?, ?, ?, ?, ?, ?) i have 7 parameteres as it was not allowing me to set the 7 th parameter without having 7 commas here.
But I'm getting the following exception even though I HAVE SET THE 4TH PARAMETER:
'java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index: 4.'