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 is pl sql architecture?
GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?
What is sql clause?
How does cross join work?
What is procedure and function in sql?
Why do we go for stored procedures?
What does select top 1 do in sql?
Which join condition can be specified using on clause?
What is scalar data type in pl sql?
What is primary key sql?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
What are the different type of joins in sql?
What is mdb stand for?
What is pl sql commands?
What are the popular database management systems in the it industry?