Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLS-00103: Encountered the symbol "LOOP" when expecting one of the....

481088Jul 31 2006 — edited Jul 31 2006
Hi,
I have a problem with PL/SQL.
I have this PL/SQL block:
DECLARE
CURSOR komm_weg IS
SELECT
kd_nr,
kom_typ,
kom_feld1,
kom_feld2
from table
where mandant = '0'
order by kom_lfd_nr;
--wrong_kom_typ EXCEPTION;
BEGIN
FOR komm_rec IN komm_weg LOOP
IF komm_rec.kom_typ = '01' THEN
update address
set
areacodetelephonep = komm_rec.kom_feld1,
numbertelephonep = komm_rec.kom_feld2
where storecode = komm_rec.kd_nr;
ELSE IF komm_rec.kom_typ = '02' THEN
update address
set
areacodetelephoneb = komm_rec.kom_feld1,
numbertelephoneb = komm_rec.kom_feld2
where storecode = komm_rec.kd_nr;
ELSE IF komm_rec.kom_typ = '03' THEN
update address
set
areacodefaxp = komm_rec.kom_feld1,
numberfaxp = komm_rec.kom_feld2
where storecode = komm_rec.kd_nr;
ELSE IF komm_rec.kom_typ = '04' THEN
update address
set
areacodefaxb = komm_rec.kom_feld1,
numberfaxb = komm_rec.kom_feld2
where storecode = komm_rec.kd_nr;
ELSE IF komm_rec.kom_typ = '05' THEN
update address
set
email = kom_feld1 || kom_feld2
where storecode = komm_rec.kd_nr;
ELSE
return;
END IF;
END LOOP;
END;
/
When I want to execute this block, the following error occurs:
ORA-06550: line 63, column 9: PLS-00103: Encountered the symbol "LOOP" when expecting one of the following: if
But I cannot expect where the mistake is.....
Does anybody have an idea what is wrong?
Thank you very much,
Tim

Message was edited by:
ehric02
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2006
Added on Jul 31 2006
6 comments
3,962 views