Home » SQL & PL/SQL » SQL & PL/SQL » query for count (9.0.4.0)
query for count [message #331041] Wed, 02 July 2008 03:50 Go to next message
user71408
Messages: 585
Registered: November 2007
Location: NE
Senior Member

Hi ,

please give me the query for following issue

Query to display count of repetitive characters in the given string.

Thank you
Re: query for count [message #331042 is a reply to message #331041] Wed, 02 July 2008 03:52 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
?????

Show us a string containing repetative characters, and tell us what the results you want is.
Re: query for count [message #331043 is a reply to message #331041] Wed, 02 July 2008 03:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As always: post what you already tried.

Regards
Michel
Re: query for count [message #331047 is a reply to message #331041] Wed, 02 July 2008 03:54 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
267 posts and this guy still doesn't 'get it'. We are NOT here to do your work for you, we will help those that put a bit of effort in.
Re: query for count [message #331049 is a reply to message #331041] Wed, 02 July 2008 03:57 Go to previous messageGo to next message
user71408
Messages: 585
Registered: November 2007
Location: NE
Senior Member

sring ::: oracle is an rdbms.

here
     S -----2 times
     a -----2 times
      .....
      ...

for this I need

o/p as
string               char_name     count
-----------------------------------------
oracle is an rdbms      s             2
                        a             2
..........

Thank you.

[Updated on: Wed, 02 July 2008 03:58]

Report message to a moderator

Re: query for count [message #331051 is a reply to message #331049] Wed, 02 July 2008 04:02 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Wed, 02 July 2008 10:52
As always: post what you already tried.

Regards
Michel


Re: query for count [message #331052 is a reply to message #331043] Wed, 02 July 2008 04:05 Go to previous messageGo to next message
user71408
Messages: 585
Registered: November 2007
Location: NE
Senior Member

Michel,

Please give the answer for the following requirement.I have tried in so many ways. This is not the right place to post forms thread. but here I am posting that thread pls give me idea for this.

Quote:
We are helping our client with upgrading customised version from 10.1.9 to 10.1.20

As a part of comparison between customised 10.1.9 and Oracle base 10.1.9, we need to run form comparison between these versions.

Our Goal: Compare forms between customised Version with Oracle Base version.

Method : Convert each .fmb file to .txt and then run a comparison between two .txt file.(Not sure if this a right way to compare as this may loose library function attached to it.)

Issue: It requires mind numbering hours of manual effort.

Your Advice: Could you please advice on bulk saving forms to text? Any other way to automate this or any tool/application that could help?



The Process I followed is
1.In Formbuilder : File -----> Administrator -----> Object
List report
But It will convert only one file at atime.But I need bulk
conversion .
2. File-----> Administrator----> binary-to-text

Thank you,

[Updated on: Wed, 02 July 2008 04:48] by Moderator

Report message to a moderator

Re: query for count [message #331070 is a reply to message #331052] Wed, 02 July 2008 04:49 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How is this a SQL question?
Use "diff".

Regards
Michel
Re: query for count [message #331072 is a reply to message #331070] Wed, 02 July 2008 04:52 Go to previous messageGo to next message
user71408
Messages: 585
Registered: November 2007
Location: NE
Senior Member

Quote:


Michel,

Please give the answer for the following requirement.I have tried in so many ways. This is not the right place to post forms thread. but here I am posting that thread pls give me idea for this.


Re: query for count [message #331116 is a reply to message #331072] Wed, 02 July 2008 05:54 Go to previous messageGo to next message
pointers
Messages: 410
Registered: May 2008
Senior Member
Check the below solution.

CREATE OR REPLACE PROCEDURE countof
AS
   v_name   VARCHAR2 (20) := 'sasivadana';
   v_type   VARCHAR2 (6);
   v_char   NUMBER;
   v_length   NUMBER;
   v_sub   VARCHAR2 (6);
   v   NUMBER        := 0;
BEGIN
   v_length := LENGTH (v_name);

   FOR s IN 1 .. v_length
   LOOP
      v_type := SUBSTR (v_name, s, 1);

      FOR q IN 0 .. s - 2
      LOOP
         v_sub := SUBSTR (v_name, q + 1, 1);

         IF v_type = v_sub
         THEN
            v := v + 1;
         END IF;
      END LOOP;

      IF (v = 0)
      THEN
         v_char := (LENGTH ('sasivadana') - LENGTH (REPLACE ('sasivadana', v_type)));
         DBMS_OUTPUT.put_line (v_char || '  ' || v_type);
      END IF;

      v := 0;
   END LOOP;
END;


SQL> set serveroutput on;

SQL> begin
  2  countof;
  3  end;
  4  /
2  s
4  a
1  i
1  v
1  d
1  n

PL/SQL procedure successfully completed.


Regards,
Srikar Dasari.
Re: query for count [message #331120 is a reply to message #331072] Wed, 02 July 2008 05:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
user71408 wrote on Wed, 02 July 2008 11:52
Quote:


Michel,

Please give the answer for the following requirement.I have tried in so many ways. This is not the right place to post forms thread. but here I am posting that thread pls give me idea for this.




Michel Cadot wrote on Wed, 02 July 2008 11:49
How is this a SQL question?
Use "diff".

Regards
Michel



If you want an answer, post a precise and correct question in the appropriate forum.
Re: query for count [message #331181 is a reply to message #331116] Wed, 02 July 2008 08:41 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Or, for the SQL afficionados out there:
with src as (select 'oracle is an rdbms' strng from dual)
select chr,count(*)
from  (select substr(strng,level,1) chr
       from   src
       connect by level <= length(strng))
group by chr
having count(*) > 1;


Anyone got a good Regexp or Model solution?
Previous Topic: Select one table base on value of another table
Next Topic: Advance Integration Implementation
Goto Forum:
  


Current Time: Tue Dec 06 12:05:16 CST 2016

Total time taken to generate the page: 0.10100 seconds