problem with add params when calling an oracle sto

Results 1 to 2 of 2

Thread: problem with add params when calling an oracle sto

  1. #1
    Join Date
    Dec 1969

    Default problem with add params when calling an oracle sto

    Hi,<BR><BR>I am getting an error when trying to add parameters when running a stored procedure, the error invalid name or ordinal reference on the following 2 lines of code:<BR><BR> comm("CustIdLoopVal") = CustIdLoopVal<BR> comm("PromoId") = "PromoId"<BR><BR>however when i comment these out, the stored procedure runs with error as it expects thesse 2 params. (the params have correct values).<BR><BR>the following is the full code:<BR><BR>Set Comm = Server.CreateObject("ADODB.Command")<BR>Set comm.ActiveConnection = cnn<BR>comm.commandtype=4 <BR>comm.commandtext = "foCust_permo.insert_cust_prmo"<BR>set param = comm.createparameter("CustIdLoopVal",3,1)<BR>set param = comm.createparameter("PromoId",3,1)<BR>set param = comm.createparameter("ReturnStatus",3,2)<BR>comm.p arameters.append param<BR><BR>&#039;Pass the input value<BR>comm("CustIdLoopVal") = CustomerIds(iLoop)<BR>comm("PromoId") = "PromoId"<BR>comm.execute<BR><BR><BR>can anyone help with what i am doing wrong here?<BR><BR>Thanks...

  2. #2
    Join Date
    Dec 1969

    Default RE: problem with add params when calling an oracle

    You need to append each parameter in turn, i.e. :<BR><BR>set param = comm.createparameter("CustIdLoopVal",3,1)<BR>comm. parameters.append param<BR>set param = comm.createparameter("PromoId",3,1)<BR>comm.parame ters.append param<BR>set param = comm.createparameter("ReturnStatus",3,2)<BR>comm.p arameters.append param<BR><BR>The way you were doing only the last parameter was actually being appended.<BR><BR>--<BR>Anglo Saxon

Posting Permissions

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