oracle error - Oracle Errors
This is a discussion on oracle error - Oracle Errors ; 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 ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| 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 |
|
#3
| |||
| |||
|
The reader.next Int() call that obtains the 'gender' value collects only digit characters. It does not does not collect the end-of-line marker that follows the digits. That end-of-line marker stays in the 'reader' object until the program calls reader.next Line() when attempting to collect the 'answer' value. That next Line() call encounters the leftover end-of-line and returns immediately, setting 'answer' to an empty String (""). Therefore 'answer' does not match the "yes" you compare it against, therefore the program goes into the 'else' clause and prints the "But seriously..." line.. |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 10:11 AM.




Linear Mode