Last line truncated [message #311842] |
Mon, 07 April 2008 02:24  |
sitangshu
Messages: 2 Registered: April 2008 Location: New Delhi
|
Junior Member |

|
|
I have written this pl/sql code but getting an error in last line while executing.
line 24 truncated which is the last line -- END;
Also, it is not showing the semicolon after 'end'
i applied two semicolons, but even then the error is not solved.
can anyone please help.
-------------------------------------------------------
DECLARE
EMPID EMPLOYEES.EMP_ID% TYPE;
EMPNAME EMPLOYEES.EMP_NAME% TYPE;
DATE_OF_BIRTH EMPLOYEES.DOB% TYPE;
DEPARTMENT EMPLOYEES.DEPT% TYPE;
REPORTING_OFFICER EMPLOYEES.REPORT_TO% TYPE;
DATEOF_JOIN EMPLOYEES.DATE_OF_JOIN% TYPE;
EMPLOYEE_STATUS EMPLOYEES.EMP_STATUS% TYPE;
PROBATION_PERIOD EMPLOYEES.PROBATION% TYPE;
CURSOR INSERT_LEAVE_ACCOUNT IS SELECT EMP_ID, EMP_NAME, DOB, DEPT, REPORT_TO, DATE_OF_JOIN, EMP_STATUS, PROBATION FROM EMPLOYEES;
BEGIN
OPEN INSERT_LEAVE_ACCOUNT;
LOOP
FETCH INSERT_LEAVE_ACCOUNT INTO EMPID, EMPNAME, DATE_OF_BIRTH, DEPARTMENT, REPORTING_OFFICER, DATEOF_JOIN, EMPLOYEE_STATUS, PROBATION_PERIOD;
IF EMPLOYEE_STATUS = 1 THEN
INSERT INTO LEAVE_ACCT VALUES (LEAVE_ACCT_SEQ.NEXTVAL, EMPID, 10, SYSDATE, 10, SYSDATE, 30, SYSDATE);
ELSE IF EMPLOYEE_STATUS = 2 THEN
INSERT INTO LEAVE_ACCT VALUES (LEAVE_ACCT_SEQ.NEXTVAL, EMPID, 10, SYSDATE, 0, SYSDATE, 0, SYSDATE);
END IF;
END IF:
DBMS_OUTPUT.PUT_LINE ('UPDATED SUCCESSFULLY');
END LOOP;
CLOSE INSERT_LEAVE_ACCOUNT;
COMMIT;
END;
|
|
|
|
|
Re: Last line truncated [message #311848 is a reply to message #311845] |
Mon, 07 April 2008 02:37   |
dhananjay
Messages: 635 Registered: March 2002 Location: Mumbai
|
Senior Member |
|
|
@dr.s.raghunathan
Quote: | surprised. error is not coming for me..
|
???
@sitangshu
Quote: | ELSE IF EMPLOYEE_STATUS = 2 THEN
|
you have to use ELSIF nd not ELSEIF.
regards,
|
|
|
Re: Last line truncated [message #311851 is a reply to message #311848] |
Mon, 07 April 2008 02:41   |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
dhananjay wrote on Mon, 07 April 2008 08:37 |
@sitangshu
Quote: | ELSE IF EMPLOYEE_STATUS = 2 THEN
|
you have to use ELSIF nd not ELSEIF.
|
He used ELSE IF and not ELSEIF and two end ifs, syntactically coeerct (maybe not the 'normal' way to do it tho')
|
|
|
|
|
|