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 / vikas gupta

Declare
l_deptname dept.deptname%Type;
l_ename dept.ename%type;
Begin
select deptname,ename
into l_deptname,l_ename
from dept
where dept_no = 30;

if sql%notfound then
dbms_output.put_line("Record was not Found")
else
dbms_output.put_line("Deptname=" l_deptname);
dbms_output.put_line("Ename=" l_ename);
end if;

end;

Is This Answer Correct ?    10 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is drop table faster than truncate?

547


What are hotfixes and patches?

527


what's the difference between a primary key and a unique key? : Sql dba

504


What is substitution variable?

577


Is postgresql a nosql database?

529






What are the indexing methods?

571


Which sorts rows in sql?

585


What is a primary key called that is made up of more than one field?

789


What is coalesce sql?

509


What is sqlca in powerbuilder?

560


What are variables in pl sql?

560


who introduced sql?

566


What is the difference between function and procedure in pl/sql?

536


what are the 'mysql' command line arguments? : Sql dba

646


Where can I learn sql for free?

503