Use The Implicit cursor to Query The Department table information Where Deptno is 30.check,if no record was found then print "Record Was Not Found".Else Print Deptname And Ename.Dept table Have Dname Varchar2(20),Deptno Number,EnameVarchar2(20).Please Answer In 2 mins,with in Maximum 15 lines.

Answer Posted / xyz

declare
cursor mycursor is
select dname,ename from emp ,dept where emp.deptno=dept.deptno and dept.deptno=30;
v_dname dept.dname%type;
v_ename emp.ename%type;
begin
open mycursor;
loop
exit when mycursor%notfound;
fetch mycursor into v_dname,v_ename;
exception
when no_data_found then
dbms_output.put_line(v_dname||' '||v_ename);
end loop;
close mycursor;
end;

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sqlite thread safe?

603


What is the difference between sum and count in sql?

518


What does 0 mean in sql?

526


what is the difference between clustered and non clustered index in sql? : Sql dba

547


Why do we use %rowtype & %type in plsql?

599






What are the two types of exceptions in pl/sql?

541


Does normalization improve performance?

552


How do you add a column to a table?

596


Are dml statements autocommit?

548


What is meant by user defined function?

579


How do I run a pl sql procedure in sql developer?

508


what are different types of keys in sql?

604


Does sql profiler affect performance?

552


What is ttitle and btitle?

572


Why is a primary key important?

545