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

What is the difference between mdf and ndf files?

780


What is a memo field?

698


Are views faster than queries?

727


What is a sql trace file?

742


How to look at the current sql*plus system settings?

763






Write a sql select query that only returns each name only once from a table?

759


how many ways we can we find the current date using mysql? : Sql dba

812


What is difference between function and trigger?

719


What is the command used to fetch the first 5 characters of a string?

928


What has stored procedures in sql?

783


Explain normalization and what are the advantages of it?

692


What language is oracle sql developer?

714


Why is %isopen always false for an implicit cursor?

767


How to select unique records from a table?

768


Can I call a procedure inside a function?

738