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
How do I save the results of sql query in a file?
What does stand for in sql?
how to load data files into tables with 'mysqlimport'? : Sql dba
Why do we use sql constraints?
Is pl sql and postgresql same?
Is sql sequential or random?
What is the use of procedures?
Why plvtab is considered as the easiest way to access the pl/sql table?
Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?
Where the sql database files are stored?
What is the advantage of index in sql?
How many types of keys are there in sql?
Explain scalar functions in sql?
What is error ora-12154: tns:could not resolve the connect identifier specified?
Why commit is not used in triggers?