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 mutating error?

502


What is an inner join sql?

540


Is postgresql a nosql database?

525


what are the types of subquery? : Sql dba

578


give the syntax of grant and revoke commands? : Sql dba

607






what is the difference between sql and t-sql? : Transact sql

591


What does <> sql mean?

528


What is the size of partition table?

542


what is the command used to fetch first 5 characters of the string? : Sql dba

1128


Is it possible to create the following trigger: before or after update trigger for each row?

714


Why should I use postgresql?

557


How does one use sql*loader to load images, sound clips and documents? : aql loader

666


What does cursor do in sql?

512


What is a database trigger?

600


Where is sql database stored?

510