I am using Orcale 10g and trying to write this stored proecdure.
CREATE PROCEDURE PRO_HOSPTAT_MTD( Years varchar2)
SELECT EXTRACT (MONTH FROM Admit_Dt) AS Actuals_Month,
COUNT (*) AS cnt,
'ADMITS' AS KPI_DESC,
'Inpatient (Main Campus)' AS Measure_Type,
1 AS Ranks
FROM VISIT_ADT_HIST vh JOIN Dept d ON vh.NEW_DEPT_ID = d.dept_id
WHERE ADT_CHANGE_TYPE IN ('1', 'IA');
AND dept_abbr NOT IN ('GMC', 'DMH', 'DHW', 'RMH', 'STAN')
AND vh.new_pt_class IN ('1', '114')
AND EXTRACT(YEAR FROM Admit_DT) = Years
GROUP BY EXTRACT (MONTH FROM Admit_Dt);
I am receiving 2 errors:
Encountered the symbol *(* when expecting one of the following :=,),@% default character The symbol *:=* was substituted for *(* to continue
Encountered the sy,bol "COMBINED" when expecting one of teh following: < a SQL statement>
I am not sure what I am doing wrong. Any assistance would be greatly apprectiated.
I am trying to write a crustal report that takes a Years parameter. My code is too long to put as a command in Crsytal so I thought a SP would be the answer. If this is not the answer does anyone have any ideas?