oracle error

This is a discussion on oracle error within the Oracle Errors forums in Oracle Database category; 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) ...

Go Back   Database Forum > Oracle Database > Oracle Errors

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-10-2008, 09:54 AM
Default oracle error

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  
Old 07-08-2008, 04:52 PM
Default Re: oracle error

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
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 11:38 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.