Anyone? Store Procedures
Good afternoon all,
I created a stored procedure in SQL from:
<cfquery name="rsDisposition" datasource="#REQUEST.datasource#">
SELECT tlkp_Defects.Defect_Title,
SUM(case WHEN tbl_Assembly_Holds.Disposition_ID = 1 then 1 else 0 end) FixedOnLine,
SUM(case WHEN tbl_Assembly_Holds.Disposition_ID = 2 then 1 else 0 end) Repair,
SUM(case WHEN tbl_Assembly_Holds.Disposition_ID = 3 then 1 else 0 end) Scrap
FROM
tbl_Assembly_Holds
join tlkp_Disposition on tbl_Assembly_Holds.Disposition_ID = tlkp_Disposition.Disposition_ID
join tbl_Assembly_Hold_Defects on tbl_Assembly_Hold_Defects.TagNumber = tbl_Assembly_Holds.TagNumber
join tlkp_Defects on tbl_Assembly_Hold_Defects.Defect_ID = tlkp_Defects.Defect_ID
WHERE
tbl_Assembly_Holds.Record_date Between '#FORM.dateFrom#' And '#FORM.dateTo#'
GROUP BY
tlkp_Defects.Defect_Title
</cfquery>
I am trying to call it from CF8 but I am getting errors, here is my code:
<cfstoredproc procedure="defect_yield" datasource="#REQUEST.datasource#">
<cfprocparam type = "IN"
CFSQLType = CF_SQL_DATE
value = "#FORM.dateFrom#">
<cfprocparam type = "IN"
CFSQLType = CF_SQL_DATE
value = "#FORM.dateTo#">
</cfstoredproc>
Any ideas on how to make this work? I want convert most of queries to Stored Procedures.
Thanks in advance,
DJ Khalif
