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 / 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 |
What is clustered, non-clustured and unique index. How many indexes can be created on a table ?
Which kind of parameters cannot have a default value in pl sql?
how many tables will create when we create table, what are they? : Sql dba
What is sql scripting?
What is a self join ?
Compare SQL and PL/SQL.
What is a left join?
How do I turn a list into a table?
Differentiate between %type and %rowtype attribute in Oracle PL/AQL programming ?
Query for second maximum salary in each in each department
15 Answers DST Global Solutions, TCS,
What are joins in sql?
I am creating an index on Emp table Empno column,if u using this indexed column in ur SELECT stmt. where clause,then how do u know that yr index will be working or nor? Thanks Advance...
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)