ANY answer.
Re: cursor based thread
errors in comments
Declare
Cursor C1 is select ename, sal, comm from emp;
--c1 declaration does not contain empno but you used it in elseif clause.that is wrong.
Begin
For i in C1 Loop
If i.comm between 299 and 999 then
Dbms_output.put_line(i.Ename || ' ** Good Commission');
Elsif i.comm > 999 then
Dbms_output.put_line(i.Empno || ' ** Very Good Commission');
-- i.empno is not declared
close C1;
--cursor is closed so you can not reference i which is implicitly declared based on cursor row.so the else clause DOPL statement will through errors
Else
Dbms_output.put_line(i.Ename || ' ** ' ||nvl(i.comm,'O'));
End if;
--- there is no exit clause
End Loop;
End;
so these are all the errors you will get.
and it looks as if this is a ocp exam question am i right?
|