How to find repeating void / string

Hello

Need help in the identification of expandable string.
Here are some examples
 Input String           Output String
   2929                      29
    22                          2
   3737                      37
   231231                  231
Thanks in advance.

Concerning
AKS
column sub_str format a10
with t as (
           select '2929' str from dual union all
           select '22' from dual union all
           select '3737' from dual union all
           select '231231' from dual union all
           select '12345' from dual
          )
-- end of on-the-fly data sample
select  str,
        regexp_replace(str,'^(.+?)\1*$','\1') sub_str
  from  t
/

STR    SUB_STR
------ ----------
2929   29
22     2
3737   37
231231 231
12345  12345

SQL>  

SY.

Tags: Database

Similar Questions

  • How to find a different string to 'off '.

    I have an array of strings, and I need to know the index of something that is different from the string "off".

    The search function for 1 table D can return me only the index where to find something, and not the index of the string that is different from this... Is there any function for this?

    For example, I have a table like the (off, off, off, standard), and I need the 3 for the standard string index.

    Thank you

    Thai

    Just re-read the question and realized that you want the index:

  • How to find a particular string in the entire schema?

    Hello world

    My version of DB is

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE 10.2.0.1.0 Production"
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    

    Suppose I have a so-called "EMAIL_ID" column in the employee table. The name of the employee is "abcd" and his email_id "[email protected]". ""

    The column name is changing "EMAIL_ID' to 'Email_Address' due to the bad standard naming convention.

    Now I only have a constant value that is " " [email protected] "... So is it possible if I write a query with this value and I'll have the list of

    tables and the exact column name where this mail_id exist?

    Kind regards

    BS2012.

    DECLARE
      ncount NUMBER;
      vwhere VARCHAR2(1000) := '';
      vselect VARCHAR2(1000) := ' select count(1) from ';
      vsearchstr VARCHAR2(1000) := '[email protected]';
    BEGIN
      FOR k IN (SELECT a.table_name
                      ,a.column_name
                  FROM user_tab_cols a
                 WHERE a.data_type LIKE '%VARCHAR%')
      LOOP
        vwhere := ' where ' || k.column_name || ' = :vsearchstr ';
        EXECUTE IMMEDIATE vselect || k.table_name || vwhere
          INTO ncount
          USING vsearchstr;
        IF (ncount > 0)
        THEN
          dbms_output.put_line(k.column_name || ' ' || k.table_name);
        END IF;
      END LOOP;
    END;
    
  • How to find the size of the text string...

    Hi friends,

    How to find the size of the text, in KB or in bytes or MB, I have a text box control, when I type a text in do I find the size of the text that is entered control.please of entry help very urgent...

    Thnaks

    Balu-

    Hi David,

    Nice Solution, but I think that it will not give the exact size of the string for a particular case where the string contains UTF string as a single letter format can exceed more than 1 byte.

    So I think it should be modified as:

    private function getTextSize(value:String): String

    {

    var div_by:int = 100;

    var sze_is:String = 'KB ';

    var len_is:int = getUTFLength (value); now the length is actually measured, regardless of the format of the text

    If (len_is > 1000000)

    {

    div_by = 100000;

    sze_is = 'mb ';

    }

    Return(string(math.round(len_is/div_by)/10)+sze_is);

    }

    private void getUTFLength(value:String):int
    {
    var byteArray:ByteArray = new ByteArray();
    byteArray.writeUTFBytes (value);
    Return CharArray.Length;
    }

    Concerning

    -Vikash

  • How to find how many times a certain data is repeated in a character field

    Hello
    I am user of Oracle 9i and a newbie to SQL.

    How to find how many times a certain data is repeated in a field in a table of character?

    for example.

    DEPT_NAME
    ------------------------------------
    Homeopathy
    Medicine
    Homeopathy
    Erices
    Homeopathy
    Surgery
    Urology
    Cardiology
    Homeopathy
    Opthamology

    DEPT_NAME here is an area of character and I want to know how many times _ 'Homeopathy' is repeated in the field "DEPT_NAME."

    [email protected] wrote:
    Hello
    I am user of Oracle 9i and a newbie to SQL.

    How to find how many times a certain data is repeated in a field in a table of character?

    for example.

    DEPT_NAME
    ------------------------------------
    Homeopathy
    Medicine
    Homeopathy
    Erices
    Homeopathy
    Surgery
    Urology
    Cardiology
    Homeopathy
    Opthamology

    DEPT_NAME here is an area of character and I want to know how many times _ 'Homeopathy' is repeated in the field "DEPT_NAME."

    You can use the COUNT aggregate function.

    SELECT count(*) FROM  WHERE dept_name = 'Homeopathy'
    
  • Find + replace text (string constant) does not work for screw Statechart module

    Hello

    I tried to do a mass find + replace a string in my code. Using Ctrl + F, LabVIEW 2012 correctly locates all the places where this string exists, including within the States transitions guards who have paths in this form:

    XYZ.lvsciagram.vi / Transition: Guard - diagram, Transition, data/part

    However, when I've specified that a replacement string, then click on 'Replace all', only 'normal' instances of screws replaced - instances in my diagrams had not changed.

    What is going on? Is there anything else I need to do?

    Thanks in advance.

    Looks like those that does not include how to find and replace is implemented in LabVIEW. You can try to replace just the statechart and see if that makes a difference, but it may simply not work.

  • How to programaticaly send a string to a box to modify another application

    Hello

    I have a question about how can an application send a string, representing a code bar, change the box (or text box) of a second application (no info on this app ctrl is available), which treats all bar codes. In addition, first application must ' press on ' a 'OK' button on the second application dialog box.

    First request, which will be written in CVI, begins by listing senior level windows, the function using Windows API - EnumWindows. Enumeration stops when the desired window's caption is found. A handle to this window will be available. I don't know how to find a handle for the control to change. There is no child window of this top-level window.

    Any suggestion on how to implement this is really appreciated.

    Concerning

    Hello all-

    @miniMe - I couldn't help but it should be noted from the information that the window you want to interact with is part of the installation of standard TestStand (modelsupport2), for which the source code is readily available.  Changing modelsupport2 is not for the faint of heart, your task is specific enough that I was able to accomplish with just a few lines of code (do not forget to copy the files from modelsupport2 to the public location before making changes).  Important components are below:

    The application that will send the number of the object to be measured can send the WM_COPYDATA message to the TestStand application.  With the help of this message is quite simple and allows you to pass data (for example a chain WEAR) beyond the limits of the process.  Here's the relevant part of my little test app that sent the message:

  • How to find the password for my Motorola Wireless?

    How to find the password for my Motorola Wireless?

    How to connect another computer to the Motorola Wireless?

    ... and now my computer won't connect to the wireless...

    Now would be a good time to use the instructions of the Setup Guide quick Motorola SBG940.

    ... I think I'll call my cable provider then!

    It may be better to talk to someone on the phone instead of trying to communicate via typed messages repeated as some of the information in the previous messages typed always seem to be lost in translation.
  • How to find the absolute position of the end of the text, it can be one or more,

    How to find the absolute position of the end of the text, it can be one or more,

    in the position I need to inseart the image of the size of the font that it friendly ordinary view sequiential - image as custom image

    Please help us find the position of the text, and even for a function more, I demanded the conclusion the text length

    I want to do we will be right and the other will be left how I can I align is their way to find the width of the label or text?

    Thank you

    This should help align your labels layouts, depending on what you did you do could go with absolute layout, docking station or stack (allows you to align the top to bottom or left to right)

    I'm not too sure that everything, however, to determine the length of the text, I would think that you could store the text in a string and then somehow programmatically count each letter & do return a result... not exactly on how to do it but it's an idea

  • How to find spaces in a file extracted in order to trigger a rule MOVE_IT

    In the studio I'm setting a field of variable on a section and I want to learn from my file extracted using a simple rule of MOVE_IT.

    I'm going to pull information from a record that has spaces columns 10-14.  How to enter the required information in the DATA field to make the request?

    For example, if I pulled the information from a record who had 'XXXXX' in column 10-14, I know that the DATA field would be 10, XXXXX

    I can't figure out how to find space at a given offset.

    Thank you.

    As you know, normally spaces are considered as a delimiter in the search string and therefore would be ignored. Doing a search for "1, ABC, 10, ' would have been a mistake that it would look like had not provided you the final search key. However, there may be a way that you can accomplish this research by using the feature 'or' without a 'or '.

    If a search key begins with open paren, it is assumed that you will provide several possible matches. For example, you could do something like this: 1, ABC, 10,(XXX,YYYY,ZZ). That said, find the line of the snippet that starts with ABC in the first column and then a XXX or AAAA or ZZ from 10th column.

    This method 'or' uses commas to separate possible matches and not break on the spaces as a normal search mask. Therefore, you can actually do: 1, ABC, 10, (de) - where I have 5 spaces between the opening and closing paren. Note that I did not put in a comma because I only had one criteria. The system doesn't care what and will simply accept what is between the parens and pick him up.

  • How to find the location of a cluster?

    If I have a Cluster123 cluster name. How to find the location of this cluster? for example, YellowFolderA/YellowFolderB/Cluster123

    Try something like this

    $clusterName = "MyCluster"
    
    $path = @()$cluster = Get-Cluster -Name $clusterName$parent = Get-View $cluster.ExtensionData.ResourcePoolwhile ($parent.parent){  $parent = Get-View $parent.parent  $path += $parent.Name}[array]::Reverse($path)[string]::Join('/',$path)
    
  • How to find the Parent Machine to a linked Clone?

    Hello

    I deployed a few clones using Lab manager, now, I wanted to find out how the clone Parent deployed to find?

    I checked in the VM, for each child VM properties, is to show the string length... I want to see information such as (uses or used by types)... Child uses clone Parent or Parent clone is used by 'x' number of clones of children...

    Please tell me how to find it?

    Kind regards

    Esxvmuser

    Hey Buddy,

    Open your configuration. You will see a list of all the VMS in your configuration.

    There is a field called 'model '. This is your parent VM.

  • How to find the delimiters

    Hello Oracle experts

    I am trying to find number of separators to a text string. But I could find only for the first record. Can you if it doesn't matter who you please let me know how to find the record2.

    I use

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    Thank you



    with t as
    (select 3999 ^ 0077774 ^ Institution ^ Mountwest ^ 1 ^ Lilly ^ Maria ^ [email protected] ^ 555-555-5555 ^ 2 ^ Lilly ^ Maria ^ [email protected] ^ 999-999-9999 ^ 3 ^ Lilly ^ Maria ^ [email protected] ^ 777-888-1234 ^ 1 yyyy xxxxxx Drxxx ^ ^ xxxxxxx ^ AA ^ 99999 ^ MRO ^ U.S. ^ ^ ^ I do not know ^ 2 years ^ Public ^ applicable ^ Urban ^ 1, 000-4, 999 ^ N ^ Conference ^ N ^ 14/04/2009 10:52:51 ^ 24/08/2010 09:26:46 ^ Active ^ ^ I ^ ^' string1 from all the double union)
    Select ' ^ ^ ^' double string1
    )
    Length (STRING1) - length (replace(STRING1,'^','')) SELECT delim_number from T

    Try:

    SELECT  length(STRING1)-NVL(length(replace(STRING1,'^','')),0) delim_number from T
    
  • How to find and view the results in flash

    Hello friends,

    I work in Flash 8 and using AS 2.0 coding.

    I work with failover-page application. Here I have an option 'search '. I'll tell you the scenario.

    Here I am loading images/pages dynamically through xml. He loading and works as a page flipping. so far, it has been done. Now if you enter some text inside the search option and press, he must search all loaded images/pages and view pages resulted.

    How this feature is indeed. How to find the jpg with a given string?

    Your help will be really appreciated.

    Kind regards

    Rajesh

    You must have a database of information related to the pages.  If the pages are only jpeg images, then they will not be able to provide you with anything in the way of useful data searchable beyond possibly titles image.  So, you will need to create a database that contains all of the information in these pages that you can have your (matching chain) diagram of function search works with to find matching information.

  • What is an xml file and how to find a missing one?

    What is an xml file? How to find one that is missing?

    In short, an XML file is a file structured data - in other words, it stores the data in a way that is easy for a computer scan and read, but it is also easy(-ish) for a human to read, too.

    Generally, XML can be used for configuration or preference data, or for the exchange of data between applications, but there are a multitude of possibilities.

    This means that, with regard to the resolution of your problem is concerned, that was no help. The whole point of XML is that it is easy for any application store some data he needs, so you need to be more specific on what application you are using and what XML file it is looking for. Only then can someone (possibly) steer you in the right direction.

Maybe you are looking for