7 Replies Latest reply: May 3, 2013 2:18 PM by 978485 RSS

    Stored Procedure Error

    ChoMan23
      I am using Orcale 10g and trying to write this stored proecdure.

      CREATE PROCEDURE PRO_HOSPTAT_MTD( Years varchar2)

      IS

      BEGIN


      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);


      end;

      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.