S
Scott
I have a SQL Stored Procedure that is I am passing several parameters to and
doing an insert into a table. The proc is doing a few other things and one
of the process is to return a confirmation number back to the the ASP page
that called the Stored Proc. How ever the DBA that created the stored proc
for me does not want to use an OUTPUT Parameter, but rather, as you can see
at the bottom of the proc, he is setting the return parameter like a result
set. My problem is, I am not sure how to get that "result set" back can you
help me. Attached is a copy of the head and tail part of the stored proc
and the part of the ASP code where I call the procedure in my site.
Everything within the procedure is working fine, I just need to know how to
get what is being returned in the "confirmation" parameter. I am not sure
if I pass it over as blank and it returns what I need or what? Hope this
makes sense.
Thanks in advance for all the help.
STORED PROCEDURE:
create proc p_eft_InsertPayment
@AgentID int,
@UserID int,
@AccountNumber varchar(50),
@Amount Float,
@PaymentType varchar(25) = null,
@CheckNbr int = null
as
set nocount on
.....
.....
....
....
set nocount off
commit tran
select @ConfirmationNbr - ***** this is what I need *********
GO
ASP CODE:
cmdpay.ActiveConnection = connpay
cmdpay.CommandText = "SYSTEM..p_eft_InsertPayment"
cmdpay.CommandType = adCMDStoredProc
cmdpay.Parameters.Append (cmdpay.CreateParameter("RetVal", adInteger,
adParamReturnValue))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@AgentID", adInteger,
adParamInput,, Session("UserAgentID")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@UserID", adInteger,
adParamInput,, Session("UserID")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@AccountNumber",
adVarChar, adParamInput, 50, Session("UserPaymentAcctNo")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@Amount", adDouble,
adParamInput, 10, Request.Form("txtPaymentAmount")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@PaymentType",
adVarChar, adParamInput, 25, Request.Form("drpPaymentType")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@CheckNbr", adInteger,
adParamInput,, Request.Form("txtCheckNumber")))
doing an insert into a table. The proc is doing a few other things and one
of the process is to return a confirmation number back to the the ASP page
that called the Stored Proc. How ever the DBA that created the stored proc
for me does not want to use an OUTPUT Parameter, but rather, as you can see
at the bottom of the proc, he is setting the return parameter like a result
set. My problem is, I am not sure how to get that "result set" back can you
help me. Attached is a copy of the head and tail part of the stored proc
and the part of the ASP code where I call the procedure in my site.
Everything within the procedure is working fine, I just need to know how to
get what is being returned in the "confirmation" parameter. I am not sure
if I pass it over as blank and it returns what I need or what? Hope this
makes sense.
Thanks in advance for all the help.
STORED PROCEDURE:
create proc p_eft_InsertPayment
@AgentID int,
@UserID int,
@AccountNumber varchar(50),
@Amount Float,
@PaymentType varchar(25) = null,
@CheckNbr int = null
as
set nocount on
.....
.....
....
....
set nocount off
commit tran
select @ConfirmationNbr - ***** this is what I need *********
GO
ASP CODE:
cmdpay.ActiveConnection = connpay
cmdpay.CommandText = "SYSTEM..p_eft_InsertPayment"
cmdpay.CommandType = adCMDStoredProc
cmdpay.Parameters.Append (cmdpay.CreateParameter("RetVal", adInteger,
adParamReturnValue))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@AgentID", adInteger,
adParamInput,, Session("UserAgentID")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@UserID", adInteger,
adParamInput,, Session("UserID")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@AccountNumber",
adVarChar, adParamInput, 50, Session("UserPaymentAcctNo")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@Amount", adDouble,
adParamInput, 10, Request.Form("txtPaymentAmount")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@PaymentType",
adVarChar, adParamInput, 25, Request.Form("drpPaymentType")))
cmdpay.Parameters.Append (cmdpay.CreateParameter("@CheckNbr", adInteger,
adParamInput,, Request.Form("txtCheckNumber")))