Advertisement

10.04.2007 at 09:01AM PDT, ID: 22872441 | Points: 75
[x]
Attachment Details

Stored procedure error: wrong number of parameters

Asked by kkoehler in WebApplications, Active Server Pages (ASP)

Tags: , , , ,

Hello:

I have a stored procedure that was written in COBOL and I am passing the parameters to ASP.  It was working fine until I added extra parameters.  I am getting an error in ASP that tells me:
IBM OLE DB Provider for DB2 error '80004005'
CLI0100E Wrong number of parameters. SQLSTATE=07001

I have compared the parameter being sent from the stored procedure to the ones in my page and they're exactly the same number of parameters.  Could the error be something else?

Below is my ASP:

      
        Set Connection = Server.CreateObject("ADODB.Connection")
      Connection.Open Application("DB2Connection")
      
      Set Command = Server.CreateObject("ADODB.Command")
      
      
      Command.ActiveConnection = Connection      
      Command.ActiveConnection.CursorLocation = 3
      
      Command.CommandText = "DBO.SP_TP_OE_CONFIRM"
      Command.CommandType = adCmdStoredProc
      
      Set AH = Server.CreateObject("ADODB.Recordset")
      
      
      if len(IDNum) > 0 THEN
            Set Param = Command.CreateParameter("P_M100_ID", adChar, adParamInput, 9, IDNum)
      else
            Set Param = Command.CreateParameter("P_M100_ID", adChar, adParamInput, 9, null)
      end if
      Command.Parameters.Append Param
      
    Command.Parameters.Append  Command.CreateParameter("P_CCYY", adInteger, adParamInput, number)
      Command.Parameters.Append  Command.CreateParameter("P_SQLCODE", adInteger, adParamOutput, number)
      Command.Parameters.Append  Command.CreateParameter("P_SQLSTATE", adChar, adParamOutput, 5)
      Command.Parameters.Append  Command.CreateParameter("P_COV_SMK_COD", adChar, adParamOutput, 1)
      Command.Parameters.Append  Command.CreateParameter("P_CVRG_COD_DES", adChar, adParamOutput, 25)
    Command.Parameters.Append  Command.CreateParameter("P_CVRG_TYP_COD", adChar, adParamOutput, 1)
      Command.Parameters.Append  Command.CreateParameter("P_CVRG_PLAN_COD", adChar, adParamOutput, 3)
      Command.Parameters.Append  Command.CreateParameter("P_MTLY_DED_AMT", adInteger, adParamOutput, number)
      Command.Parameters.Append  Command.CreateParameter("P_TABLEDTL", adChar, adParamOutput, 3)
      Command.Parameters.Append  Command.CreateParameter("P_CVRG_COD_DES2", adChar, adParamOutput, 25)
      Command.Parameters.Append  Command.CreateParameter("P_EBC_CMT_TYP_COD", adChar, adParamOutput, 4)
      Command.Parameters.Append  Command.CreateParameter("P_DECD", adChar, adParamOutput, 8)

      Err.Clear
      
      Set AH = Command.Execute()


This are the parameters being sent from the stored procedure:

    IN  P_M100_ID                     CHARACTER(9)
  ,IN   P_CCYY                        INTEGER
  ,OUT  P_SQLCODE                     INTEGER
  ,OUT  P_SQLSTATE                    CHARACTER(5)
  ,OUT  P_SMK_COD                     CHARACTER(1)
  ,OUT  P_CVRG_COD_DES                CHARACTER(25)
  ,OUT  P_CVRG_TYP_COD                CHARACTER(1)
  ,OUT  P_CVRG_PLAN_COD               CHARACTER(3)
  ,OUT  P_MTLY_DED_AMT                DECIMAL(6, 2)
  ,OUT P_TABLEDTL                     CHARACTER(7)
  ,OUT  P_CVRG_COD_DES2               CHARACTER(25)
  ,OUT  P_EBC_CMT_TYP_COD             CHARACTER(4)
  ,OUT  P_DECD                        CHARACTER(8)


Any help or suggestions will be appreciated.

KarlaStart Free Trial
[+][-]10.04.2007 at 11:34AM PDT, ID: 20016540

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.04.2007 at 11:44AM PDT, ID: 20016612

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.05.2007 at 10:33AM PDT, ID: 20023851

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.05.2007 at 12:10PM PDT, ID: 20024719

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2007 at 08:52AM PDT, ID: 20034916

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2007 at 10:25AM PDT, ID: 20035496

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628