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 / radha sri seshu.kolla
WHEN YOU ARE USING CURSOR WIH FOR LOOP NO NEED TO SPECIFY
CLOSE CURSOR.
SINGLE CORES ARE LOOKING AS IF THEY ARE SINGLE CORES, BUT
THEY ARE SPECIAL CHARACTERS.
YOU ARE USIGN NVL FUNCTION IN THIS. YOU GAVE FIRST ARGUMENT
AS NUMBER DATATYPE, AND SECOND IS CHARACTER DATA TYPE. 0
AND O LOOK LIKE SAME JUST IT IS TO CONFUSE THE CANDIDATES.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How does a covering index work?
Define implicit and explicit cursors.
What is Histogram?
How to select unique records from a table?
What are user defined functions?
Explain some predefined exceptions.
Explain clause in sql?
how many groups of data types? : Sql dba
What is the reports view in oracle sql developer?
What does the base_object_type column shows in the user.triggers data dictionary view?
Which command is used to delete a package?
What is nosql example?
Are there any features that are decommissioned in 11g that are not present in 11g?
what are the authentication modes in sql server? How can it be changed? : Sql dba
What is the difference between an inner join and an outer join?