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 / ramprasad.s
Hi Anaswer to your question
IS
declare
cursor C1 is select ENAME,SAL,COMM from EMP;
begin
For i IN C1 loop
IF i.comm > 299 AND i.comm < 999 then
dbms_output.put_line(i.ENAME || ' ' || '** Good
commission');
ELSIF i.comm >999 then
dbms_output.put_line(i.ENAME || ' ' || '** Very Good
commission');
ELSE
dbms_output.put_line(i.ENAME || ' ' || NVL(COMM,0));
END IF;
END LOOP;
END;
sun_ramprasad@yahoo.com
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we use pl sql in mysql?
Is clustered index a primary key?
Can we join more than 2 tables in sql?
Why truncate is faster than delete?
What are the types of join and explain each?
Define commit?
What is a table partition?
can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba
How many types of literals are available in pl sql?
What are the two types of periodical indexes?
What are the steps for performance tuning.
Can we commit in trigger?
How many disk partitions should I have?
What type of database is sql?
When to use inner join and left join?