Select the five digits (or more) column varchar2 numbers

Hi all

I've got varchar2 column, it consists of different text, numbers, spaces, commas, etc.
My need is to choose only five-digit numbers (or more).

For example: 251 or 2512 is not what I need.
25123 or 251234 or 2512345... is what I need.

How can I make it?

Something like...

select regexp_substr(txt, '[0-9]{5,}') as fivedigs
from tablename

Tags: Database

Similar Questions

  • Select the distinct value of a column in the collection in bulk.

    Hi all

    Collecting the data of a query to a variable of type table. I need to select a separate of a perticular column value in the collection.

    Collection has followiing values inside.
    Col(c).articleid,
    Col(c).userkey,
    Col(c).origin,
    Col(c).addnlorigindata,
    Col(c).avdest,
    Col(c).dispfmt,
    Col(c).sourcecode,
    Col(c).success_ind,
    Col(c).error_code,
    Col(c).entry_createddate,
    Col(c).createdby,
    Col(c).filenumber,
    Col(c).linenumber,
    Col(c).acctnum,
    Col(c).assetkey,
    Col(c).autocompletedterm,
    Col(c).accessionnumber,
    Col(c).requestdatetime,
    Col(c).requestorip,
    Col(c).articleordinal,
    Col(c).userinitiatedind,
    Col(c).captchastatus
    I need to select distinct column values (for example: Col (c) .sourcecode) collection and the need to insert in the table if the value in this column does not exist in the table.

    Say, Col (c) .sourcecode has the value XYZ, ABC. If the "XYZ" value does not exist in the table, so I need to insert in the table and if "ABC" exists in the tables then don't insert it. (something like fusion) after seecting to the distinct values in a column in the collection.

    Thanks n regards
    Nana Akkivalli.

    The collection must be inserted before you can use this topic.

    In the Begin block, you have to collect a loose and insert inside: something like

    SELECT *
    BULK COLLECT INTO l_array
    FROM ALL_USER
    ...CONDITIONS...
    
  • WIN8 cannot select the user when connecting more

    I used to have the option to select the user to connect as but now I have a screen that says:

    Press Ctrl + Alt + Delete or use the Windows Security button to unlock

    When I hit Ctrl + Alt + Delete I get only the most recent user login.  If I hit the left arrow right top left of the image, I must return to the Ctrl + Alt + Delete screen.  There is no way I can see to select another user.

    If the current user remembers actually disconnect from the screen Ctrl + Alt + Delete I am taken to a login with a choice of the users screen.

    This used to work and I don't know if my 5 yo changed something or if a updated Windows did something.  But my wife and son both need to use this notebook so I really need separate accounts.

    I found a few long really complex stuff on the ' net on the definition of the strategy group and fiddle with the registry but I know my 5 yo did nothing like that.

    How do I change back?

    Dennis

    PS what is the "Windows Security button" anyway?

    I realized that I had recently installed Cisco AnyConnect VPN software to connect to the work.  Which of - installed and now life is still happy.  I will contact Cisco.

    Sorry for the short reply above.  Validation has been broken here earlier today and several machines at the same time making a response and a new post, I didn't type a bunch just to get the "Oops, something went wrong" again.

    Dennis

  • Name of Member validation must contains the five digits in the form of numeric if the account Type selected as ASSET

    Hi team,

    I have a business requirement that I like "validate a HFM member account name must contains the first 3 digits as digital if the user select type of HFM account as ASSET.

    Ex; Member account name: 123_Cash, 125_Loans, 234_Machinery (these members returns true) if these accounts "Type of account selected as active.

    I wrote a rule like below, but it is not validate properly and returns true for all members regardless of either digital or alphabets.

    IF (is equal to (String, varValeurProp (Custom.HFMAccountType), Asset),is equal to (integer, substring (propvalue (Core.Abbrev), 1, 3), 1), True)


    Please correct this validation rule.

    Thank you is advanced...

    Kind regards

    Laurianne

    Hi Andrew,

    Try this,

    If)

    Equals (String, propvalue (Custom.HFMAccountType), Asset),

    IsNumeric (substring (propvalue (Core.Abbrev), 1, 3), False), True)

  • How to return the highest value in a column of numbers less than a given number

    I am a beginner using formulas in number.  I have an inventory in a Numbers spreadsheet (v3.6.2).  Inventory numbers are in a column.  I need to view the last number used or the highest number less than a given value.  In my case, it is 9000.

    I can put a cell to return MAX and it's cool, but I need to know the number < 9000, MAX.

    Hi JS.

    SEARCH is your friend here. One of the properties of the LOOKUP function is that it accepts a 'close-match', which is defined as the largest value less than or equal to the search value.

    Formulas:

    A2: LOOKUP (8999.9999999, D)

    B2: LOOKUP(9000,D)

    C2: MAX (D)

    Kind regards

    Barry

  • Selective, the combination of files with odd and numbers of pages

    Hi all! First of all, I hope this is the right forum for my question. It has been asked before, but not fully answered. My problem is to combine several PDF files with the addition of a blank page that those that contain numbers of odd pages, those with even numbers must be left alone. I need a fast and automatic way to do this, so I can save a lot of time in the face of a massive number of files. If this can be done simply, is there a way to sort all the files so that the whole group, only those with odd page numbers go to a specified folder? As this does not I have the same problem when converting, say Word scared several files in 1 pdf file pdf factory.

    Thanks in advance! In addition, any other way to go around this problem is more than welcome!

    See you soon!

    If you have Acrobat X Pro., you can perform this Action that will automatically insert a blank page when the page number is odd. It is downloadable from the exchange of shares AcrobatUsers.com.

  • Close the startpoint and endpoint without selecting the first

    Hi guys,.

    I'm working on an image of polygon which means I have created hundreds and hundreds of small triangles with the path tool.

    Now, I have wondered if it is possible to create two lines of the triangle in hand and close the last third line of triangles in shortcut.

    There may be a shortcut (or almost) to connect the beginning and the end of a path? I know I can do it by clicking on cmd + J, but I first select the points which is more work than simply connecting them to the hand. It would be perfect if there's any way to close it without selecting it first, so that I can do an 'action' out of it with a shortcut!

    Any ideas?

    Pathfinder unite.

  • How to select the csv data stored in a BLOB column as if it were an external table?

    Hi all

    (Happy to be back after a while! )

    Currently I am working on a site where users should be able to load the data of csv (comma is the separator) of their client machines (APEX 3.2 application) in the Oracle 11.2.0.4.0 EE database.

    My problem is:

    I can't use an external table (for the first time in my life ) so I'm a little clueless what to do as the csv data is stored by the application of the APEX in a BLOB column, and I'm looking for an elegant way (at least SQL PL/SQL/maximization) to insert the data into the destination table (run validations by a MERGER would be the most effective way to do the job).

    I found a few examples, but I think they are too heavy and there could be a more elegant way in Oracle DB 11.2.

    Simple unit test:

    drop table CBC purge;

    drop table dst serving;

    create table src

    (myblob blob

    );

    create table dst

    (num number

    , varchar2 (6) str

    );

    Insert in src

    Select utl_raw.cast_to_raw (1; AAAAAA ;'|| Chr (10) |

    2; BATH; »

    )

    Double;

    Desired (of course) output based on the data in table SRC:

    SQL > select * DST;

    NUM STR

    ---------- ------

    1 ABDELKRIM

    2 BATH

    Does anybody know a solution for this?

    Any ideas/pointers/links/examples are welcome!

    / * WARNING: I was 'off' for about 3 months, then the Oracle - the part of my brain has become a bit "rusty and I feel it should not be so complicated as the examples I've found sofar ' * /"

    Haha, wonder about regexp is like the blind leading the blind!

    However, it's my mistake: I forgot to put the starting position setting (so 1, 2, 3,... was in fact the starting position, not the nth occurrence. duh!)

    So, it should actually be:

    select x.*
    ,      regexp_substr(x.col1, '[^;]+', 1, 1)
    ,      regexp_substr(x.col1, '[^;]+', 1, 2)
    ,      regexp_substr(x.col1, '[^;]+', 1, 3)
    ,      regexp_substr(x.col1, '[^;]+', 1, 4)
    ,      regexp_substr(x.col1, '[^;]+', 1, 5)
    ,      regexp_substr(x.col1, '[^;]+', 1, 6)
    from  src
    ,      xmltable('/a/b'
                  passing xmltype(''||replace(conv_to_clob(src.myblob), chr(10), '')||'')
                  columns
                    col1 varchar2(100) path '.') x;
    

    Note: that's assuming that all the "columns" passed in the string won't be lame.

    If one of them might be null, then:

    select x.*
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 1)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 2)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 3)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 4)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 5)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 6)
    from   src
    ,      xmltable('/a/b'
                  passing xmltype(replace(';'||replace(conv_to_clob(src.myblob), chr(10), ';')||'', ';;', '; ;'))
                  columns
                    col1 varchar2(100) path '.') x;
    
  • Select the list with the list of dynamic values with more than 4000 tank of query

    Hello

    I have no application where users can store SQL queries in a CLOB column. This query is then used to populate the list, select a dynamic element through LOV. Following the code returns the query for dynamic LOV used to populate the select list. It works fine except when the length of the lv_sqlStatement becomes more than 4000 characters. Then application crashes with "ORA-06502: PL/SQL: digital or value error: character string buffer too small" when Select the list item rendering.

    Any ideas how to get around this problem? Any help is appreciated. Do not say to them to write shorter than 4000 queries because I can't (it's operational requirements).

    DECLARE
    lv_sqlStatement end_user_set.sql_statement%type;
    BEGIN
    lv_sqlStatement: =: P2_SQL_STATEMENT;
    return ' select the label, value of (' | lv_sql_statement | t ')
    To_char (t.value) if not in (select value from end_user_set_member eusm)
    where eusm. EUSRSET_ID = ' | : P2_EUSRSET_ID | ')';
    END;

    I just blogged about this problem and posted a solution. See this announcement:

    http://www.deneskubicek.blogspot.de/2013/03/select-list-with-dynamic-lov-and-Ora.html

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • cannot find the table name of the multiple tables which has more columns.

    Hello

    I'm trying to find the NAME of the TABLE from multiple tables which has more columns. I can't count the number of columns in the table, but cannot find the name of the table that has larger columns in other tables.

    SELECT TABLE_NAME, COUNT (*) FROM THE USER_TAB_COLUMNS WHERE TABLE_NAME LIKE '% LOC' GROUP TABLE_NAME


    Thank you.

    in SQL, you can try this:

    var v_name varchar2(40)
    
    begin
       with
          subq1 as ( select table_name, count(*) as column_count from user_tab_columns where table_name like 'FIBER%'
                         group by table_name
                         order by count(*) desc )
       select table_name
         into :v_name
        from subq1
       where rownum = 1;
    end;
    

    To get the result:

    select :v_name from dual
    

    The clause "with" brings together all the tables and ordered them all first, by the greatest number of columns
    The final query uses the rownum restriction so that it takes the first name from the table of results of the subquery.

    The restriction of rownum also exactly guarantees a result each time so that it will work with the variable binding.

    RP

  • Select the value inside the digital

    For more convenience, I would that the behavior of my digital controls for automatic selection the entire value when I click on the control.  So when it gets the focus, the value should be selected.

    I don't see a way to do this.  Any ideas?  The increment on a digital buttons will select, but these data types that I put to float.  Then increment does not much sense.  In my case, I the user perforation in values with the keyboard.  It would be nice to not have to select the 0.000 already present before data entry.

    Thoughts?

    @gdargaud: with a small modification of your idea can work!

    Just to simulate a House + shift - end event to select text:

    	If (event == EVENT_GOT_FOCUS) {}
    FakeKeystroke (VAL_HOME_VKEY);
    FakeKeystroke (VAL_SHIFT_MODIFIER |) VAL_END_VKEY);
    }

    This is valid for text and digital controls.

  • Select the value of the field in the database column stores xml as a varchar

    Hi all

    Oracle version is 11 GR 2.

    I have a column of a database in which we store the XML string varchar2.

    "I need to extract only newvalue when field nameof the property ="modifiedBy'. '.

    In this case my answer would be - maker16

    My XML is as below.

    with t as
    (
    select '<?xml version="1.0" encoding="UTF-8"?>
    <changeinfo><property name="checkedOn" newvalue="03/21/2013 15:51:11" oldvalue="03/21/2013"/><property name="modifiedOn" newvalue="07/22/2013 14:04:55" oldvalue="03/21/2013"/><property name="phoneNo" newvalue="9942251"/><property name="modifiedBy" newvalue="maker16" oldvalue="clarissamaker"/></changeinfo>' as datacolumn
    FROM dual
    )
    select extractvalue(datacolumn,'/changeinfo/property name[@property name="modifiedBy"]/newvalue') from t;
    
    

    How to write a select statement to get the above result?

    Thank you

    SID

    You can do it like

    1. get the name and NewValue as columns and then create a filter with the WHERE clause.

    2. or you can filter when you set the path itself.

    --I have not applied the WHERE clause to filter the NAME. You can do that.
    
    SQL> with t as
      2  (
      3  select '
      4  
      5  
      6  
      7  
      8  
      9  ' as datacolumn
     10  FROM dual
     11  )
     12  select t1.name, t1.newval
     13    from t
     14       , xmltable
     15         (
     16            '/changeinfo/property' passing xmltype(datacolumn)
     17            columns
     18              name varchar2(100) path '@name',
     19              newval varchar2(100) path '@newvalue'
     20         ) t1;
    
    NAME                           NEWVAL
    ------------------------------ ------------------------------
    checkedOn                      03/21/2013 15:51:11
    modifiedOn                     07/22/2013 14:04:55
    phoneNo                        9942251
    modifiedBy                     maker16
    
    --This filters the Name attribute in the path definition itself.
    
    SQL> with t as
      2  (
      3  select '
      4  
      5  
      6  
      7  
      8  
      9  ' as datacolumn
     10  FROM dual
     11  )
     12  select t1.newval
     13    from t
     14       , xmltable
     15         (
     16            '/changeinfo/property[@name="modifiedBy"]' passing xmltype(datacolumn)
     17            columns
     18              newval varchar2(100) path '@newvalue'
     19         ) t1;
    
    NEWVAL
    ------------------------------
    maker16
    

    And the $ 1 million question would be why VARCHAR2 type of XML data.

  • Select the column name when the value = something

    Is there a way to select the column name when there is a specific value in it?

    As follows:

    create table (abc123)

    COLUMN1 VARCHAR2 (50).

    COLUMN2 VARCHAR2 (50).

    Column3 varchar2 (50)

    );

    insert into abc123 values ('yes', 'Yes', 'No');

    insert into abc123 values ('no', 'Yes', 'No');

    INSERT INTO ABC123 VALUES ('no ',' no', 'No');

    insert into abc123 values ('yes', 'Yes', 'Yes');

    SELECT CASE WHEN COLUMN1 = 'Yes' THEN - the name of the column would be here somehow?

    WHEN COLUMN2 = 'Yes' THEN - the name of the column would be here somehow?

    WHERE Column3 = 'Yes' THEN - the name of the column would be here somehow?

    Another null

    finish as abc123 columnname

    final results for the just Column1 would be:

    COLUMN1

    NULL VALUE

    NULL VALUE

    COLUMN1

    I'm not sure what I use to get the name of column in there

    Thank you.

    Hello

    708631 wrote:

    Is there a way to select the column name when there is a specific value in it?

    As follows:

    create table (abc123)

    COLUMN1 VARCHAR2 (50).

    COLUMN2 VARCHAR2 (50).

    Column3 varchar2 (50)

    );

    insert into abc123 values ('yes', 'Yes', 'No');

    insert into abc123 values ('no', 'Yes', 'No');

    INSERT INTO ABC123 VALUES ('no ',' no', 'No');

    insert into abc123 values ('yes', 'Yes', 'Yes');

    SELECT CASE WHEN COLUMN1 = 'Yes' THEN - the name of the column would be here somehow?

    WHEN COLUMN2 = 'Yes' THEN - the name of the column would be here somehow?

    WHERE Column3 = 'Yes' THEN - the name of the column would be here somehow?

    Another null

    finish as abc123 columnname

    final results for the just Column1 would be:

    COLUMN1

    NULL VALUE

    NULL VALUE

    COLUMN1

    I'm not sure what I use to get the name of column in there

    Thank you.

    Thanks for posting the CREATE TABLE and INSERT for the sample data.

    Don't forget to post the exact results you want from these sample data.  If the results depend on the parameters you want to pass a run time, then give a few different examples, with the the desired results of each.

    You can hardcode the values you want, such as the column names in a query.  For example:

    SELECT CASE WHEN column1 = 'Yes' THEN 'Column1' END like y1

    CASE WHEN column2 = 'Yes' THEN 'Column2' END like y2

    CASE WHEN Column3 = 'Yes' THEN 'Column2' END like y3

    , a. *-If wanted

    Of abc123 one

    ;

  • Select the column in a table that is defined in the select previous in the statement

    Hello

    I want to write a procedure that selects all the data in a table has then records them in the text file. I tested on table hr.countries.

    My code is like this:

    echo off newpage 0 space 0 pagesize 0 feed head off trimspool check out serveroutput on the value

    coil countries.txt

    define dtable = COUNTRY;

    declare

    col_num NUMBER;

    no_lig NUMBER;

    line VARCHAR2 (100);

    Col VARCHAR2 (100);

    Start

    Select count (COLUMN_ID) in the col_num USER_TAB_COLUMNS WHERE table_name = '& dtable';

    Select count (*) in no_lig of & dtable;

    because me in 1.row_num

    loop

    1.col_num j

    loop

    Select column_name from col FROM USER_TAB_COLUMNS WHERE table_name = '& dtable' and column_id = j;

    Select the pass in the row (select col, rownum: nurse of (select col from & dtable)) where rn = i;

    IF (j! = col_num) THEN

    DBMS_OUTPUT. PUT(Row ||) ', ');

    ON THE OTHER

    DBMS_OUTPUT. PUT (Row);

    END IF;

    end loop;

    DBMS_OUTPUT. NEW_LINE;

    end loop;

    end;

    /

    spool off

    I have had no error, but the result is like this:

    COUNTRY_ID, COUNTRY_NAME, REGION_ID

    COUNTRY_ID, COUNTRY_NAME, REGION_ID

    COUNTRY_ID, COUNTRY_NAME, REGION_ID

    .. and so on for the whole table.

    I want to have results with data not only the names of columns. No idea what is the problem? I thought that select col online would do the thing, but the line is identical to the col variable...

    Thank you

    Honza

    Set serveroutput on;

    define dtable = COUNTRY;

    declare

    col_num NUMBER;

    no_lig NUMBER;

    line VARCHAR2 (100);

    Col VARCHAR2 (100);

    Start

    Select count (COLUMN_ID) in the col_num USER_TAB_COLUMNS WHERE table_name = '& dtable;

    Select count (*) in the no_lig argument of &dtable;

    because me in 1.row_num

    loop

    1.col_num j

    loop

    Select column_name from col FROM USER_TAB_COLUMNS WHERE table_name = '& dtable' and column_id = j;

    run immediately 'select'. Col | "from (select ' |) Col |', rownum: nurse from (select ' |) Col |' of & dtable)) where rn =' | I have

    Online;

    IF (j! = col_num) THEN

    DBMS_OUTPUT. PUT(Row ||) ', ');

    ON THE OTHER

    DBMS_OUTPUT. PUT (Row);

    END IF;

    end loop;

    DBMS_OUTPUT. NEW_LINE;

    end loop;

    end;

    /

    Output

    anonymous block filled

    AR, Argentina, 2

    To, Australia, 3

    BEING, Belgium, 1

    BR, Brazil, 2

    CA, Canada, 2

    CH, Switzerland, 1

    CN, China, 3

    OF (Germany), 1

    DK, Denmark, 1

    For example, Egypt, 4

    FR, France, 1

    HE, Israel, 4

    IN, India, 3

    IT, Italy, 1

    JP, Japan, 3

    KW, Kuwait, 4

    ML, Malaysia, 3

    MX, Mexico, 2

    NG, Nigeria, 4

    NL, Netherlands, 1

    SG, Singapore, 3

    UK, United Kingdom, 1

    WE, United States of America, 2

    ZM Zambia, 4

    ZW, Zimbabwe, 4

  • It is possible to select a column of text tabbed without selecting the adjacent column of the tabulated text?

    I have two columns of text created with tabs. I want to select the first column without selecting the second column (I want to format the first column differently). Hope it would be possible to drag a marquee on it and have it select but apparently not. Will do it line by line, but for later use, would like to know if there is a way.

    David

    Creates the tabbed table text would allow you to do. It will give you much more control over the formatting as well.

    To change the text tabs in a table, select the text with tabs and choose table > convert text to table.

Maybe you are looking for

  • regarding Google as my default search engine

    I spent my default search to google engine. but everytime I open Firefox, I keep getting the additional window giving me instructions on how to do it again. He's crazy my OCD perfectionist. Help, please. Laughing out loud

  • EliteBook 8540p bluescreen - test memory failed

    Dear readers, My HP elitebook 8540p was serve me a long time, but recently, it displays a blue screen and resets after entering the windows password. Diagnosis at the start to say: Memory test: failed Failure ID: UOEDUC-56C77E-XD7U3G-40N603 Product I

  • M277DW: Photo M277DW paper

    I'm looking photo paper for my printer and the printer specification suggests Matt paper 200 g and up to 220 g glossy one. HP store offers 2 different photo for my printer, two A4 size papers, but I need a format 10 x 15 cm too. I found this article

  • Windows Media Center - EPG "no data available" of 01.01.2013

    Can I update my Guide in Media Center - without any error, but almost all my channels will display "no data available" from the 01.01.2013. Everything worked perfectly until now. It seems to have been a cut-off time. Indicates the end date of the Gui

  • ACS 5.2 - Adding custom for Juniper Netscreen GANYMEDE + authentication attributes

    Hello I'm trying to add custom for authentication Juniper Netscreen GANYMEDE + an ACS v5.2 attributes. The notice is to add it to the group as follows: ervice = netscreen { vsys = root privilege = read-write } I know how this adds a version v4.x ACS