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


Please Help Members By Posting Answers For Below Questions

What does stand for in sql?

620


How do you modify a column in sql?

643


Can variables be used in sql statements?

644


Do we need to create index on primary key?

556


How do I kill a query in postgresql?

652






Why we use pl sql?

613


How to change sql*plus system settings?

633


Is t sql a programming language?

629


What is audit logout in sql profiler?

670


what is top in tsql? : Transact sql

634


How would you pass hints to the sql processor?

622


How to return an array from java to pl/sql?

686


What are variables in pl sql?

671


How can I change database name in sql?

611


What is the difference between cluster and non-cluster index?

715