Dear All,
Question for this Week
Find out possible error(s) (either at compile
time or at runtime) in the following PL/SQL block. State
the reason(s) and correct the errors.
Declare
Cursor C1 is select ename, sal, comm from emp;
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’);
close C1;
Else
Dbms_output.put_line(i.Ename || ‘
** ’ ||nvl(i.comm,‘O’));
End if;
End Loop;
End;
Answer Posted / umadevi
Declare
Cursor C1 is select empno, ename, sal, comm from
emp;
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');
Else
Dbms_output.put_line(i.Ename || '**
' || ( i.comm||','||'O'));
End if;
End Loop;
End;
/
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is dml statement?
What is clustered index in sql?
what is union? : Sql dba
In what condition is it good to disable a trigger?
Explain how exception handling is done in advance pl/sql?
Why use subqueries instead of joins?
What is rename command in sql?
how to use like conditions? : Sql dba
What is cascade in sql?
Can we use having without group by in sql?
Is stored procedure faster than query?
How to fix oracle error ora-00942: table or view does not exist
What is not null in sql?
What are all ddl commands?
Inline the values in PL/SQL, what does it mean.?