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 a cursor? : Sql dba
The in operator may be used if you know the exact value you want to return for at least one of the columns.
How do you take the union of two tables in sql?
Is pl sql a programming language?
How we can update the view?
Explain what is a database?
how can we encrypt and decrypt a data present in a mysql table using mysql? : Sql dba
What is pl sql record in oracle?
What is nvarchar in sql?
What is posting?
What does rownum mean in sql?
How do I order by ascending in sql?
what are sequences
what is rollback? : Sql dba
how to use myisamchk to check or repair myisam tables? : Sql dba