Avatar of chalie001
chalie001
 asked on

loop having error

hi how can i write this code better
fdeclare

cursor get_emp_id is
    select id form emp_temp
	   where name = :block.itemName;
begin
for curr3 in get_emp_id loop
		
		wrk_curr_emp :=  GEN_CURRENT_empaccNo(curr3.id);
	
		
		if wrk_curr_nsn != curr3.id then
			message('this is not current accno');
			raise form_trigger_failure;
		else
			:block.idNr := curr3.id
		elsif wrk_curr_nsn != curr3.id  then
				:block.idnr := 	wrk_curr_emp;
			end if;
		--	end if;
		
	
		end loop;
end;		

Open in new window

DatabasesOracle DatabaseSQLMongoDB

Avatar of undefined
Last Comment
chalie001

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
flow01

You probably wil have compilation errors on
fdeclare  >  declare
and the
  if   then
  else
  elsif then
  end if;
>
  if   then
  elsif then
  else
  end if;

But  since its not clear what you want to do :  correct compiled does not always mean better.
flow01

Oops, reaction was to late.
SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
chalie001

ASKER
if statement was having issue
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck