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 / swastik

declare
v_deptno number(2) := &gdeptno;
v_dname varchar2(20);
v_ename   varchar2(20);
begin
select deptno, dname, ename into v_deptno, v_dname, v_ename 
from dept
where deptno = v_deptno;
dbms_output.put_line(v_deptno|| ' '||v_dname||' '||v_ename);
exception
when no_data_found
then
dbms_output.put_line('record was not found');
end;
/

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many sectors are in a partition?

549


Explain correlated query work?

583


What is sql rowcount?

550


What steps server process has to take to execute an update statement?

502


how can we find the number of rows in a table using mysql? : Sql dba

575






What does partition by mean in sql?

507


What is data definition language?

616


Can cursors be part of a trigger body?

1107


what is auto increment? : Sql dba

563


Is sql procedural language?

547


How do you delete duplicates in sql query using rowid?

531


What are secondary keys?

552


Do we need commit after truncate?

603


What do you understand by case manipulation functions?

539


What are the types of triggers in sql?

490