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
how to present a past time in hours, minutes and seconds? : Sql dba
What are reports usually used for?
How many joins can you have in sql?
What is a subquery in sql?
What is oracle sql developer?
What is synchronized subquery?
Explain the difference in execution of triggers and stored procedures?
Why we use pl sql?
Do foreign keys improve performance?
What is a native sql query?
what is the difference between delete and truncate commands? : Sql dba
What are the different datatypes available in PL/SQL?
Explain what is a column in a table?
What is pl sql in oracle?
how to use case expression? : Sql dba