My codes goal is to cause a Phantom row. I understand the process but I'm struggling to get my first sql script to run
CREATE OR REPLACE PROCEDURE PHANTOM
IS
DECLARE
ENAME CHAR;
ENAME EMPLOYEE%ROWTYPE;
BEGIN
SELECT * INTO ENAME
FROM EMPLOYEE
WHERE NAME = 'Albert';
DBMS_OUTPUT.PUT_LINE(ENAME.NAME);
DBMS_LOCK.SLEEP(15);
DBMS_OUTPUT.PUT_LINE(ENAME.NAME);
END;
/
This is my first Script in which a variable ENAME of type char is declared and takes on the value of NAME from a table EMPLOYEE where name is equal to Albert. The variable is then called in a DMBS statement in order to return the name. My 2nd Script only contains an update an a commit to complete the phantom process.
When i try and compile this procedure i get two errors
error 1
Error(5,1): PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: begin function pragma procedure subtype type <an identifier> <a double-quoted delimited-identifier> current cursor delete exists prior external language The symbol "begin" was substituted for "DECLARE" to continue.
error 2
Error(21,5): PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ( begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge json_exists json_value json_query json_object json_array
how can i fix this issue? Thankyou