Error Executing Script: PLS-00103: Encountered the symbol "DECLARE"

Discussion of open issues, suggestions and bugs regarding database management and development tools for Oracle
Post Reply
alexa

Re: Error Executing Script: PLS-00103: Encountered the symbol "DECLARE"

Post by alexa » Fri 02 Nov 2018 10:08

We will investigate this issue and will answer you as soon as possible.

alexa

Re: Error Executing Script: PLS-00103: Encountered the symbol "DECLARE"

Post by alexa » Tue 06 Nov 2018 10:35

The following script causes no errors on our side:

Code: Select all

--##REMARKS make sure we have permission to do things
DECLARE
SDDL settingsdatatype.datatypevarchar2000 % TYPE;
BEGIN
SDDL := 'PURGE RECYCLEBIN';

--DBMS_OUTPUT.Put_Line(sDDL);
EXECUTE IMMEDIATE SDDL;
EXCEPTION
WHEN OTHERS THEN NULL;
END;
/

--##REMARKS First check there is at least some content in the LHAPPT
DECLARE
NCOUNT settingsdatatype.datatypeint % TYPE;
NODATA EXCEPTION;
BEGIN
SELECT COUNT(rpttaskid)
INTO NCOUNT
FROM lhappt_owner.rpttask;

IF NCOUNT = 0
THEN
RAISE NODATA;
END IF;
END;
/

--##REMARKS DISABLE ALL TRIGGERS IN LHAPP_OWNER
DECLARE
SDDL settingsdatatype.datatypevarchar2000 % TYPE;

CURSOR C1 IS
SELECT *
FROM SYS.ALL_TRIGGERS
WHERE OWNER = 'LHAPP_OWNER'
AND TRIGGER_NAME <> 'TRIG_LHSESSION'
AND TRIGGER_NAME <> 'TRIG_COMPUTEREXTEVENTHISTORY'
ORDER BY TABLE_NAME;
BEGIN
FOR C1REC IN C1
LOOP
SDDL := 'ALTER TRIGGER LHAPP_OWNER.' || C1REC.TRIGGER_NAME || ' DISABLE';

--DBMS_OUTPUT.Put_Line(sDDL);
EXECUTE IMMEDIATE SDDL;
END LOOP;
END;

Post Reply