I have this procedure:
PROCEDURE P_SUMMARIZE_ACTIVATED
(
pStartDate IN DATE,
pEndDate IN DATE,
SummaryCur OUT MEGAGREEN_CUR
)
IS
BEGIN
OPEN SummaryCur FOR
SELECT USER_ID,
sum(case SERVICETYPE_ID WHEN 1 THEN 1 ELSE 0 END) AS Package1,
SUM(CASE SERVICETYPE_ID WHEN 2 THEN 1 ELSE 0 END) AS Package2,
SUM(CASE SERVICETYPE_ID WHEN 3 THEN 1 ELSE 0 END) AS Package3,
(Package1 + Package2 + Package3) AS TOTAL
FROM ALL_ADSL
WHERE ACTIVATION_DATE BETWEEN pStartDate AND pEndDate
group by USER_ID
ORDER BY USER_ID;
END;
This procedure cannot be complied, SQL Developer returns this error:
Error(544,36): PL/SQL: ORA-00904: "PACKAGE3": invalid identifier
How can I do to fix that?
Thank you.