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

What is trigger and how to use it in sql?

1007


How to select unique records from a table?

1037


Can we use views in stored procedure?

1018


What is set serveroutput on in pl sql?

1272


how is exception handling handled in mysql? : Sql dba

1062


What is structural independence and why is it important?

1016


Is grant a ddl statement?

886


What are the query optimization techniques?

914


What are different types of queries in sql?

1103


What is Difference Between Unique and Primary Key Constraints?

1094


How do I write a cron which will run a sql query and mail the results to agroup?

960


Which column of the user triggers data dictionary view displays the database event that will fire the trigger?

1009


What's the difference between inner join and left join?

984


what is the difference between cluster and non cluster index? : Sql dba

1007


Which command is used to call a stored procedure?

988