| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| declare CURSOR one is SELECT personnum, ABSENCEDATE,paycodename, excusedsw, pcexcusedsw FROM vp_absence; personnums number; firstdates Date; paycodenames varchar(50); counts number; seconddate date; personnumss varchar(10); paycodenamess varchar(50); TempDates Date; TempDatess Date; firstdatess Date; Excuseds varchar(10); pExcuseds varchar(10); paycodenamesss varchar(50); personnumsss varchar(10); Excusedss varchar(10); pExcusedss varchar(10); begin OPEN one; FETCH one into personnums,firstdatess,paycodenames,excuseds,pexcu seds; delete from tkcsowner.DummyTable11; TempDatess:=firstdatess; firstdates:=firstdatess; WHILE one% found loop FETCH one into personnumss,seconddate,paycodenamess,Excusedss,pEx cusedss; paycodenamesss:=paycodenamess; if (seconddate=firstdates+1) then if (personnumss=personnums) then if (paycodenamess=paycodenames) then TempDates:=firstdates; firstdates:=seconddate; paycodenamesss:=paycodenamess; paycodenames:=paycodenamess; personnums:=personnumss; excuseds:=Excusedss; dbms_output.put_line('jkj2'); Else if (paycodenamess is Null and paycodenames is Null) then TempDates:=firstdates; firstdates:=seconddate; paycodenamesss:=paycodenamess; paycodenames:=paycodenamess; personnums:=personnumss; excuseds:=Excusedss; dbms_output.put_line('jkj3'); Else if (paycodenamess != paycodenames) then Insert into tkcsowner.DummyTAble11 values(personnums,TempDatess,firstdates,paycodenam es,excuseds,excuseds); commit; excuseds:=Excusedss; TempDatess:=Seconddate; firstdates:=Seconddate; paycodenames:=paycodenamess; personnums:=personnumss; End if; Else Insert into tkcsowner.DummyTABle11 values(personnums,TempDatess,firstdates,paycodenam es,excuseds,excuseds); commit; excuseds:=Excusedss; TempDatess:=Seconddate; firstdates:=Seconddate; paycodenames:=paycodenamess; personnums:=personnumss; dbms_output.put_line('jkj4'); End if; else Insert into tkcsowner.DummyTABle11 values(personnums,TempDatess,firstdates,paycodenam es,excuseds,excuseds); commit; excuseds:=Excusedss; TempDatess:=Seconddate; firstdates:=Seconddate; paycodenames:=paycodenamess; personnums:=personnumss; dbms_output.put_line('ppkj'); end if; end loop; close one; end; i am getting error as The following error has occurred: ORA-06550: line 76, column 14: PLS-00103: Encountered the symbol "ELSE" when expecting one of the following: begin case declare end exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe ORA-06550: line 90, column 28: PLS-00103: Encountered the symbol "ELSE" ORA-06550: line 108, column 1: PLS-00103: Encountered the symbol "END" plse help me soon |
|
#2
|
| If you are not going to take the time to indent your code you will have this problem all of the time. One of the issues: Look at the end, you have an ELSE after the End If. This Else does not match with any if because of the end if; FETCH one into personnumss,seconddate,paycodenamess,Excusedss,pEx cusedss; paycodenamesss:=paycodenamess; if (seconddate=firstdates+1) then if (personnumss=personnums) then if (paycodenamess=paycodenames) then TempDates:=firstdates; firstdates:=seconddate; paycodenamesss:=paycodenamess; paycodenames:=paycodenamess; personnums:=personnumss; excuseds:=Excusedss; dbms_output.put_line('jkj2'); Else if (paycodenamess is Null and paycodenames is Null) then TempDates:=firstdates; firstdates:=seconddate; paycodenamesss:=paycodenamess; paycodenames:=paycodenamess; personnums:=personnumss; excuseds:=Excusedss; dbms_output.put_line('jkj3'); Else if (paycodenamess != paycodenames) then Insert into tkcsowner.DummyTAble11 values(personnums,TempDatess,firstdates,paycodenam es,excuseds,excuseds); commit; excuseds:=Excusedss; TempDatess:=Seconddate; firstdates:=Seconddate; paycodenames:=paycodenamess; personnums:=personnumss; End if; Else |
![]() |
| Thread Tools | |
| Display Modes | |