way_ching
asked on
parameter not supplied for stored procedure
Hi
I have been fustrated by a stupid problem as stated in the title.
I did create the appropriate parameters in the Parameters collection and assign them values.
I looped thru the Parameters collection and make sure it matches the stored procedure input parameter list.
But when i execute myCommand.Execute, I keep getting an error saying that I did not supply a parameter which that sp expects.
Can someone tell me what did i do wrong?
the following is the asp code:
Set spCmd = Server.CreateObject("ADODB .Command")
Set spCmd.ActiveConnection = conn2
spCmd.CommandType = adCmdStoredProc
spCmd.CommandText = "dbo.lsp_updateForm4"
spCmd.Parameters.Append spCmd.CreateParameter("tra nsit", adVarchar, adParamInput, 10)
spCmd.Parameters.Append spCmd.CreateParameter("lin eNum", adInteger, adParamInput)
spCmd.Parameters.Append spCmd.CreateParameter("q3f orecast", adDouble, adParamInput)
spCmd.Parameters.Append spCmd.CreateParameter("q4e stimate", adDouble, adParamInput)
spCmd.Parameters.Append spCmd.CreateParameter("q1b udget", adDouble, adParamInput)
spCmd.Parameters.Append spCmd.CreateParameter("q2b udget", adDouble, adParamInput)
spCmd.Parameters.Append spCmd.CreateParameter("q3b udget", adDouble, adParamInput)
spCmd.Parameters.Append spCmd.CreateParameter("q4b udget", adDouble, adParamInput)
with spcmd
.Parameters("transit") = "00000"
.Parameters("lineNum") = 1
.Parameters("q3forecast") = 100
.Parameters("q4estimate") = 100
.Parameters("q1budget") = 100
.Parameters("q2budget") = 100
.Parameters("q3budget") = 100
.Parameters("q4budget") = 100
.Execute
end with
And the procedure looks like this:
CREATE PROCEDURE dbo.lsp_updateForm4
@transit nvarchar(10),
@lineNum int,
@lastyractual float = NULL,
@q1actual float = NULL,
@q2actual float = NULL,
@q3forecast float,
@q4estimate float,
@q1budget float,
@q2budget float,
@q3budget float,
@q4budget float
I have been fustrated by a stupid problem as stated in the title.
I did create the appropriate parameters in the Parameters collection and assign them values.
I looped thru the Parameters collection and make sure it matches the stored procedure input parameter list.
But when i execute myCommand.Execute, I keep getting an error saying that I did not supply a parameter which that sp expects.
Can someone tell me what did i do wrong?
the following is the asp code:
Set spCmd = Server.CreateObject("ADODB
Set spCmd.ActiveConnection = conn2
spCmd.CommandType = adCmdStoredProc
spCmd.CommandText = "dbo.lsp_updateForm4"
spCmd.Parameters.Append spCmd.CreateParameter("tra
spCmd.Parameters.Append spCmd.CreateParameter("lin
spCmd.Parameters.Append spCmd.CreateParameter("q3f
spCmd.Parameters.Append spCmd.CreateParameter("q4e
spCmd.Parameters.Append spCmd.CreateParameter("q1b
spCmd.Parameters.Append spCmd.CreateParameter("q2b
spCmd.Parameters.Append spCmd.CreateParameter("q3b
spCmd.Parameters.Append spCmd.CreateParameter("q4b
with spcmd
.Parameters("transit") = "00000"
.Parameters("lineNum") = 1
.Parameters("q3forecast") = 100
.Parameters("q4estimate") = 100
.Parameters("q1budget") = 100
.Parameters("q2budget") = 100
.Parameters("q3budget") = 100
.Parameters("q4budget") = 100
.Execute
end with
And the procedure looks like this:
CREATE PROCEDURE dbo.lsp_updateForm4
@transit nvarchar(10),
@lineNum int,
@lastyractual float = NULL,
@q1actual float = NULL,
@q2actual float = NULL,
@q3forecast float,
@q4estimate float,
@q1budget float,
@q2budget float,
@q3budget float,
@q4budget float
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi Anthony
Thanks for your answer. :)
Just another quick question, does the order of creating the parameters in ASP matter?
THanks for reminding me about my open questions. I already graded the answer.
Thanks for your answer. :)
Just another quick question, does the order of creating the parameters in ASP matter?
THanks for reminding me about my open questions. I already graded the answer.
>>Just another quick question, does the order of creating the parameters in ASP matter? <<
My understanding is that the order (and obviously type, length, direction, etc.) that the parameters are created is important, the names are not. But I have never taken the time to prove that.
Anthony
My understanding is that the order (and obviously type, length, direction, etc.) that the parameters are created is important, the names are not. But I have never taken the time to prove that.
Anthony
ASKER
Yep. I just tested it. The order does matter.
No wonder the application keeps giving me incorrect result.
No wonder the application keeps giving me incorrect result.
Auto-detection and removal of dead process on AIX Date: 10/04/2001 11:52PM PST
https://www.experts-exchange.com/questions/20191043/Auto-detection-and-removal-of-dead-process-on-AIX.html
Compressing data before saving to tapes when using Informix ontape command Date: 09/10/2001 02:39AM PST
https://www.experts-exchange.com/questions/20180843/Compressing-data-before-saving-to-tapes-when-using-Informix-ontape-command.html
Thanks,
Anthony