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
Define SQL and state the differences between SQL and other conventional programming Languages?
Why are indexes and views important to an organization?
What is the difference between null value, zero, and blank space?
Which is better join or inner query?
What is pl sql variable?
What is trigger in sql? Explain
What is the max nvarchar size?
What is the limitation on the block size of pl/sql?
what is cross join? : Sql dba
what is the use of friend function? : Sql dba
What is a sql select statement?
What is the benefit of foreign key?
What is dml with example?
Why coalesce is used in sql?
can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba