Announcement Announcement Module
Collapse
No announcement yet.
Getting SQL state [null]; error code [17041]; Missing IN or OUT parameter at index:: Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting SQL state [null]; error code [17041]; Missing IN or OUT parameter at index::

    I think I am doing everything correct. However, I am getting following error --
    org.springframework.jdbc.UncategorizedSQLException : CallableStatementCallback; uncategorized SQLException for SQL [{call SCOC01.GETEMPCOCHIST.UspGetEmpCoCHist(?, ?, ?, ?, ?)}]; SQL state [null]; error code [17041]; Missing IN or OUT parameter at index:: 5; nested exception is java.sql.SQLException: Missing IN or OUT parameter at index:: 5

    Basically Stored procedure has one input parameter and 4 Resultsets as output parametere. Here is the code --

    public class CoCUspGetEmpCoCHistProcedure extends StoredProcedure {

    private static Logger log = Logger.getLogger("com.testoracle.CoCUspGetEmpCoCHi stProcedure");
    public CoCUspGetEmpCoCHistProcedure(DataSource ds)
    {

    super(ds, COCNamespace.SPROC_UspGetEmpCoCHist);

    declareParameter(new SqlParameter(COCNamespace.IN_EMP_ID, Types.CHAR));
    declareParameter(new SqlOutParameter(COCNamespace.OUT_ACK_TS_SET,Oracle Types.CURSOR ,new AcknowledgeMapper()));
    declareParameter(new SqlOutParameter(COCNamespace.OUT_DISCLO_TS_SET,Ora cleTypes.CURSOR ,new DisclosureMapper()));
    declareParameter(new SqlOutParameter(COCNamespace.OUT_TRAIN_DT_SET,Orac leTypes.CURSOR ,new TrainingMapper()));
    declareParameter(new SqlOutParameter(COCNamespace.OUT_PERS_AUD_CONFLICT _SET,OracleTypes.CURSOR ,new AuditorConflictMapper()));
    compile();

    }

    public Map execute(Map inputs)
    {
    return super.execute(inputs);
    }


    // RowMapper implementation class for resultset from COC_ACK table

    private static final class AcknowledgeMapper implements RowMapper
    {

    public Object mapRow(ResultSet rs, int rowNum) throws SQLException
    {
    log.debug("Inside AcknowledgeMapper");
    return (Timestamp)rs.getTimestamp("ACK_TS");
    }
    }

    // RowMapper implementation class for resultset from DISCLOSURE table

    private static final class DisclosureMapper implements RowMapper
    {

    public Object mapRow(ResultSet rs, int rowNum) throws SQLException
    {
    log.debug("Inside DisclosureMapper");
    return (Timestamp)rs.getTimestamp("DISCLO_TS");
    }
    }


    // RowMapper implementation class for resultset from TRAINING table

    private static final class TrainingMapper implements RowMapper
    {

    public Object mapRow(ResultSet rs, int rowNum) throws SQLException
    {
    log.debug("Inside TrainingMapper");
    return (Date)rs.getDate("TRAIN_DT");
    }
    }


    // RowMapper implementation class for resultset from AUDITOR_CONFLICT table

    private static final class AuditorConflictMapper implements RowMapper
    {

    public Object mapRow(ResultSet rs, int rowNum) throws SQLException
    {
    log.debug("Inside AuditorConflictMapper");
    return (Timestamp)rs.getTimestamp("PERS_AUD_CONFLICT_TS") ;
    }
    }


    }

    We are using Oracle Database 10g Enterprise Edition Release 10.2.0.3.0. Also I have made sure that we are using correct ojdbc14.jar. Other stored procedures with only output parameter are working properly.

    F1...F1...F1

    Thanks,
    Vishwajit

  • #2
    The code looks correct - can you turn on DEBIG logging for org.springframework.jdbc and post the relevant parts - it should show the parameters being set

    Comment

    Working...
    X