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
What does fetching a cursor do?
What is mutating table error?
Explain table and field in sql?
how do you tune the slow running queries in oracle db , explain the methodology
Explain what is rdbms?
What is rank () in sql?
Can a varchar be a primary key?
What is sql and also describe types of sql statements?
What are stored procedures used for?
Is pl sql different from sql?
Does pdo prevent sql injection?
Why does sql need a server?
How does cross join work?
what is the difference between char and varchar data types? : Sql dba
What is execute immediate?