How would I convert the following SQL statement to an Oracle stored procedure?
Any help is appreciated. Thanks.
Code:
SELECT A.WORKTYPE, COUNT(*) AS ITEMCOUNT
FROM REPORTLS.RETAIL_PROCESSLOG A, REPORTLS.WORKTYPES B
WHERE A.WORKTYPE = B.WORKTYPE
AND TRUNC(ENDLOCKTIME) >= TO_DATE('&FromDate','MM/DD/YYYY')
AND TRUNC(ENDLOCKTIME) <= TO_DATE('&ToDate','MM/DD/YYYY')
AND DEPARTMENT = '&DEPARTMENT'
GROUP BY A.WORKTYPE
Any help is appreciated. Thanks.