Oracle Stored Procedures With 2 Input Parameters

Results 1 to 2 of 2

Thread: Oracle Stored Procedures With 2 Input Parameters

  1. #1
    R. Mullins Guest

    Default Oracle Stored Procedures With 2 Input Parameters

    I&#039;m trying to send two input parameters to an Oracle Stored procedure from ASP. When I<BR> have sent one input parameter to a stored procedure from the same ASP code it has<BR> worked. But errors with two. This Oracle Package expects two input parameters. I used<BR> the following code to send up the input parameters:<BR><BR><BR> objNCRDetailCommand.Parameters(cNCR_IDParam).Direc tion = 1 &#039;* adParamInput<BR> objNCRDetailCommand.Parameters(cNCR_IDParam).Value = 3 &#039;* Set the input param to the<BR> selected ID<BR><BR> objNCRDetailCommand.Parameters(cITYPEParam).Direct ion = 1 &#039;* adParamInput<BR> objNCRDetailCommand.Parameters(cITYPEParam).Value = "NEW" &#039;* Set the input param to the<BR> selected ID <BR><BR> I get the following error:<BR><BR> Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR> [Microsoft][ODBC driver for Oracle]Invalid parameter number <BR><BR> /dev/GetNCRDetails2.asp, line 82 <BR><BR> How do I send more than one parameter successfully? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: Oracle Stored Procedures With 2 Input Paramete

    Assuming you have tested your stored procedure separately, here is another way of creating parameters:<BR><BR>dim pId,pType<BR><BR>objNCRDetailCommand.CommandText = "&#060;storedproc name&#062;"<BR>objNCRDetailCommand.CommandType = 4<BR><BR>Set pId = objNCRDetailCommand.CreateParameter("&#060;name of parameter1&#062;",&#060;Data type&#062;,1,&#060;max size of param&#062;,3)<BR>objNCRDetailCommand.Parameters.a ppend pId <BR><BR>Set pType = objNCRDetailCommand.CreateParameter("&#060;name of parameter2&#062;",&#060;Data type&#062;,1,&#060;max size of param&#062;,"NEW" )<BR>objNCRDetailCommand.Parameters.append pType<BR><BR><BR>********************************* *<BR>The .CreateParameter method of the Command object takes five parameters:<BR><BR>1) name of field in stored proc<BR>2) type of field(uses same values in DataTypeEnum section of<BR> 129 = Char<BR> 200 = Varchar<BR> 131 = Numbers<BR>3) direction of parameter<BR> 0 = unknown<BR> 1 = input<BR> 2 = output<BR> 3 = input/output<BR> 4 = return value<BR>4) maximum size of parameter<BR>5) value of parameter<BR><BR><BR>Hope this helps<BR>Pete<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts