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 / intejar ahmad

invalid single quotes and cursor does not selecy empno

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why query optimization is needed?

505


Can you have more than one trigger on a table?

513


What is a database event trigger?

575


Explain clause in sql?

552


What is cursor status?

753






Why do we create stored procedures & functions in pl/sql and how are they different?

494


What is an exception in PL/SQL? What are the two types of exceptions?

613


how many values can the set function of mysql take? : Sql dba

523


How long will it take to learn pl sql?

512


Is left join inner or outer by default?

515


How do I remove all records from a table?

555


What are the types of dbms?

539


Is sql port 1433 encrypted?

556


Does sql support programming?

541


What is a database trigger?

592