DECLARE
COUNTING1 NUMBER(1);
BEGIN
SELECT COUNT(VACATION_REMAINING_COUNT)
INTO COUNTING1
FROM VACATION
WHERE NAME = :P0_VNAME;
IF COUNTING1 > 0 THEN
SELECT VACATION_REMAINING_COUNT
FROM
(
SELECT ROW_NUMBER() OVER (ORDER BY CREATED DESC) ROW_ID,
V.VACATION_REMAINING_COUNT
FROM VACATION V
WHERE NAME = :P0_VNAME
)
WHERE ROW_ID = 1;
ELSE
SELECT USER_YEAR_VACATION FROM VA_USER WHERE NAME = :P0_VNAME;
END IF;
END;
ORA-06550: line 1, column 114: PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: ( - + case mod new not null continue avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe
I wrote this sql code. but An error has occurred. please help me..