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

How to find the count of letter "L" in HELLO

Answer Posted / dinesh

// in SQL:------------------------------------------
Select length('hello')-length(replace('hello','l','')) From
DUAL;

// IN PL/SQL:-------------------------------------------

create or replace Procedure count_char(name varchar2,c varchar2) IS
m number(11):=0;
d number(11);
a number(11);
b number(11):=1;
BEGIN
a:=length(name);
for i in 1..a
LOOP
IF INSTR(NAME,c,b)>=1 THEN
d:=INSTR(NAME,c,b);
m:=m+1;
b:=d;
END IF;
b:=b+1;
END LOOP;
DBMS_OUTPUT.PUT_LINE('count of '||' '||c ||' '||'is'||' '|| m||' '||'in'||' '||name);
end;

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is faster joins or subqueries?

1034


What are the types of join and explain each?

1100


How do you delete data from a table?

1097


How can I delete duplicate rows?

1062


Is it mandatory for the primary key to be given a value when a new record is inserted?

1251


What are the different dcl commands in sql?

1229


Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?

1122


Can a select statement fire a trigger?

1205


What is minus?

1051


Can instead of triggers be used to fire once for each statement on a view?

1006


Which are the different types of indexes in sql?

1098


How do you sort in sql?

1067


How many indexes can be created on a table in sql?

1110


What is the use of index in hive?

1052


How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?

1105