Link to home
Start Free TrialLog in
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

ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Oops, reaction was to late.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chalie001
chalie001

ASKER

if statement was having issue