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 are inner and outer joins examples of both?
What is snowflake sql?
how to show all tables with 'mysql'? : Sql dba
what is data manipulation language? : Sql dba
what is online transaction processing (oltp)? : Sql dba
what is a constraint? Tell me about its various levels. : Sql dba
What does trigger mean in psychology?
How delete all data from all tables in sql?
What is sql lookup?
What are the uses of merge?
Can we perform dml on view?
How do I run a sql query?
how many triggers are allowed in mysql table? : Sql dba
How can you save or place your msg in a table?
how to check server status with 'mysqladmin'? : Sql dba