Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is offset and limit in sql?

998


What is the sql*loader? : aql loader

1003


What is a record in pl/sql?

1070


Explain the difference between 'between' & 'and' operators in sql

945


Can two tables have same primary key?

915


What are different categories of sql commands?

1067


What are the different dcl commands in sql?

1064


How do you update a sql procedure?

970


Does varchar need length?

932


Show how functions and procedures are called in a pl/sql block.

1041


Which operator is used in query for pattern matching?

1032


what are local and global variables and their differences? : Sql dba

1008


How many types of triggers are there in pl sql?

1011


How bulk collect improves performance?

946


What is the requirement of self-join?

1025