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...

table :-
city name country code
abc 11
bcd 22
cde 232
def 33

write a procedure , so that when we give a phone no. eg -
1123456789 -
o/p sud be city name = abc

if phone no. - 2322345897 , o/p sud be =cde

note - bcd and cde city name sud be diff. as dey diff only
with th last no.

Pls ans. this questnion.

Answer Posted / pravellika

create or replace procedure check1 (num number)
is
cursor c1(id number) is select b.a,b.city,b.code from (
select instr(id,code,1,1) as a,city,code from t1 )b
where b.a=1;
v_id number;
v_code NUMBER;
v_city VARCHAR2(100);
begin
open c1(num);
loop
fetch c1 into v_id,v_city,v_code;
exit when c1%notfound;
dbms_output.put_line(v_city||' '||v_code);
end loop;
close c1;
end;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Histogram?

1549


What are the most important ddl statements in sql?

1088


Explain polymorphism in pl/sql.

1096


What is the least restrictive isolation level? : Transact sql

1048


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

1166


What is trigger in sql and its types?

1042


What is trigger types of trigger?

1050


what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba

940


What is meaning of <> in sql?

1057


What is the difference between view and stored procedure?

950


tell me about various levels of constraint. : Sql dba

1026


What is the order of sql select?

1030


Why use truncate instead of delete?

992


Explain the significance of the & and && operators in pl sql.

989


What are different types of indexes?

996