I currently have a sql statement that works great. I want to convert it
to a stored procedure so I can generate results from a webpage. Below
is the stored procedure that is working fine.
select SUBSTRING(tblPe rsonnel.SSN_SM, 6,9) AS L4,
SIDPERS_PERS_UN IT_TBL.UNAME,
SIDPERS_PERS_UN IT_TBL.ADDR_CIT Y, SIDPERS_PERS_UN IT_TBL.PR_NBR,
[tblPersonnel].[ADDR_CITY] + ' ' + [tblPersonnel].[ZIP] AS HOR,
SMOSC=(case [tblSTAP Info].[SMOS Considered]
when "1" then "Yes"
else "No"
end),
FIRSTSGTC =(case [tblSTAP Info].[1SG]
when "1" then "Yes"
else "No"
end),
CSMC=(case [tblSTAP Info].[CSM]
when "1" then "Yes"
else "No"
end),
tblPersonnel.*, [tblSTAP Info].*
FROM SIDPERS_PERS_UN IT_TBL
INNER JOIN (tblPersonnel INNER JOIN [tblSTAP Info] ON
tblPersonnel.SS N_SM = [tblSTAP Info].SSN)
ON SIDPERS_PERS_UN IT_TBL.UPC = tblPersonnel.UP C
WHERE (SIDPERS_PERS_U NIT_TBL.RPT_SEQ _CODE LIKE ('AA__')) and
(tblPersonnel.P AY_GR = 'E5')
and (SUBSTRING (tblPersonnel.P MOS,1,3) IN ('71L', '75H'))
and ([tblSTAP Info].TotalPoints >=
(case tblPersonnel.PA Y_GR
when "E4" then 350
when "E5" then 400
when "E6" then 450
when "E7" then 500
when "E8" then 600
else 0
end))
AND [tblSTAP Info].NotConsidered = 0
ORDER BY tblPersonnel.PA Y_GR DESC , [tblSTAP Info].TotalPoints DESC ,
tblPersonnel.NA ME_IND;
I would like the 3 items under the where clause to recieve a variable
from the website:
(SIDPERS_PERS_U NIT_TBL.RPT_SEQ _CODE LIKE ('AA__'))
(tblPersonnel.P AY_GR = 'E5')
(SUBSTRING (tblPersonnel.P MOS,1,3) IN ('71L', '75H'))
Everytime I try to make this a stored procedure and try to pass multiple
values in the PMOS field, I get an error stating too many variables.
If anyone can tell me what the Stored Procedure should look like AND
what the ASP should look like to pass the variables, I would be much
obliged.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
to a stored procedure so I can generate results from a webpage. Below
is the stored procedure that is working fine.
select SUBSTRING(tblPe rsonnel.SSN_SM, 6,9) AS L4,
SIDPERS_PERS_UN IT_TBL.UNAME,
SIDPERS_PERS_UN IT_TBL.ADDR_CIT Y, SIDPERS_PERS_UN IT_TBL.PR_NBR,
[tblPersonnel].[ADDR_CITY] + ' ' + [tblPersonnel].[ZIP] AS HOR,
SMOSC=(case [tblSTAP Info].[SMOS Considered]
when "1" then "Yes"
else "No"
end),
FIRSTSGTC =(case [tblSTAP Info].[1SG]
when "1" then "Yes"
else "No"
end),
CSMC=(case [tblSTAP Info].[CSM]
when "1" then "Yes"
else "No"
end),
tblPersonnel.*, [tblSTAP Info].*
FROM SIDPERS_PERS_UN IT_TBL
INNER JOIN (tblPersonnel INNER JOIN [tblSTAP Info] ON
tblPersonnel.SS N_SM = [tblSTAP Info].SSN)
ON SIDPERS_PERS_UN IT_TBL.UPC = tblPersonnel.UP C
WHERE (SIDPERS_PERS_U NIT_TBL.RPT_SEQ _CODE LIKE ('AA__')) and
(tblPersonnel.P AY_GR = 'E5')
and (SUBSTRING (tblPersonnel.P MOS,1,3) IN ('71L', '75H'))
and ([tblSTAP Info].TotalPoints >=
(case tblPersonnel.PA Y_GR
when "E4" then 350
when "E5" then 400
when "E6" then 450
when "E7" then 500
when "E8" then 600
else 0
end))
AND [tblSTAP Info].NotConsidered = 0
ORDER BY tblPersonnel.PA Y_GR DESC , [tblSTAP Info].TotalPoints DESC ,
tblPersonnel.NA ME_IND;
I would like the 3 items under the where clause to recieve a variable
from the website:
(SIDPERS_PERS_U NIT_TBL.RPT_SEQ _CODE LIKE ('AA__'))
(tblPersonnel.P AY_GR = 'E5')
(SUBSTRING (tblPersonnel.P MOS,1,3) IN ('71L', '75H'))
Everytime I try to make this a stored procedure and try to pass multiple
values in the PMOS field, I get an error stating too many variables.
If anyone can tell me what the Stored Procedure should look like AND
what the ASP should look like to pass the variables, I would be much
obliged.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Comment