ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
   
 
Categories  >>  Software  >>  Databases  >>  SQL PLSQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
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.
 Question Submitted By :: Lizamishra15
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
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
Pravellika
 

 
 
 
Other SQL PLSQL Interview Questions
 
  Question Asked @ Answers
 
HOW CAN I FIND MAX SAL ,ENAME FROM EMP TABLE.  16
query to retrive the employees whose sal is greater than avg sal TCS9
how to get enames with comma seperated values by deptwise on emp table?  5
Is it possible to use LONG columns in WHERE clause or ORDER BY?  1
What are the usage of SAVEPOINTS?  4
if we give update table_name set column_name= default. what will happen? its given in pl sql block.what will hapen? iFlex5
what is outer join? what is selef join? what is difference between them? what is cartecion join? Synechron1
wirte a query to filter improper date format follwing table? date 20-apr 22-may-2010 26-jun-2010 feb-2009 i want the output date 22-may-2010 26-jun-2010 Accenture4
Write a procedure to return the month and the number of developers joined in each month (cursor ) Tech-Mahindra1
What is the difference between SQL and PLSQL IBM4
Can you have multiple SPs with the same name on a database? CGI5
what is global temporary tables and how use that tables in pl/sql packages Cap-Gemini1
 
For more SQL PLSQL Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2012  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com