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
What are sql*plus environment variables?
Can I copy :old and :new pseudo-records in/to an oracle stored procedure?
How do I kill a query in postgresql?
Can sql function call stored procedure?
How does left join work in sql?
what is the use of friend function? : Sql dba
what is the difference between nested subquery and correlated subquery?
What are the different types of triggers?
Can we join two tables without common column?
Which sql most popular?
What is the requirement of self-join?
Is full outer join same as cross join?
What is an exception in pl/sql?
Differentiate between pl/sql and sql?
how to create a new table in mysql? : Sql dba