avoid using regexp

Hello

I have some channels like 'CCM:234567776767:99978' and I need to extract and save the number in the two ":", so in this case 234567776767.

Is it possible by using the regular expression, or should I do use substr and instr?

Thank you!

SELECT REGEXP_SUBSTR)

':' || "CCM:234567776767:99978,"

':([^:]*)',

1,

2,

NULL,

1

)

FROM DUAL;

Tags: Database

Similar Questions

  • How to avoid using MAX (CASE... WHEN) in a subquery

    Hi everyone, for all of you gurus plsql, I have a question:

    SELECT a.id,

    B.SID,

    b.Name,

    ....

    (CASE WHEN sub_c.value_c = '2015' AND a.code > = 1111 'output value is' | a.value_a ELSE 'Random value' END) output

    FROM table_a a,.

    Table_B b,

    ...

    (SELECT C.a_id

    MAX (CASE WHEN c.code <>'A'

    THEN c.value

    Value_c END)

    OF table_c

    GROUP BY c.a_id

    ) sub_c

    WHERE a.id = b.a_id

    AND a.id = sub_c.a_id (+)

    If they all want table_c a_id, and WHEN the condition is not convinced that they still want this allowance a_id even with null for value_c.

    I tried to outline the most important parts, so the question is: is there a way to avoid using this construction MAX - CASE somewhat expedite this request?

    Thanks for a ton to all those who have taken need to watch this!

    You can move the CASE WHEN c.code <> 'A' predicate in the where clause table_c. Index c.code, then use

    Max (c.value)...

    where c.code <> "A".

    If you have a lot of 'A' values that can speed things up.

  • Customized using regexp check constraint

    Oracle 11.2.0.1

    I need a customized using regexp expressions check constraint.  We have a single column in our table REGNO, which is used to keep the registration number of our customers.  It has alpha and numeric values, the first is Alpha and rest is digital with preceding zeros as A0100 A1245, C1111 etc.  Sometimes, in the application user enters regnos evil if we want to stop entering the bad regnos i.e. assume that the user name is Ashok Kumar and in the series, we have 1000 users so this new user should have A1001 (other than any value A1001, in this example, the constraint must be limit to enter the value) only, not the others nor a1001 , A1000, nor A1002 or < has no > 1001 too. Rather than having 26 sequences (A to Z), we get a table where we have these columns:

    Alpha char (1), number of LastNo.  But sometimes a user enters wrong number value and stores it in the table, so next time for the same gap alpha arrives and confusing.

    So, we must have a constraint of database level so that ONLY the correct values must be entered.

    Kindly help me how I have this task please.

    Thank you.

    If REGNO is a derived value then why let you the user enter a value. Just generate the user.

  • How to avoid using fractions of EPUB available pixels fixed.

    Apple said to avoid the use of fractional pixels for letter spacing, font size and text placement. Since then, sometimes in the conversion to html and css formatting. Is there a way I can control this?

    Someone had their book rejected because of this?

    Thank you!

    It is perhaps not the droids you are looking for, but a way to check after the fact would be to create a copy of your epub, rename the epub to [epubnam] .zip (change .epub to .zip) and then find the .0px, .1px, .2px generated css file... (if you're handy with regular expressions, you could do a little better by looking for------.) ([0-9] * px, I checked it quickly to regexpal.com, but more robust tests may be in order)

    If you find a fractional value, you could "fix" no closest fractional value which is not trash your design and repackage the epub.

    FWIW, I did a quick scan through my epub css and can't find any decimal values.

  • How to search for a string in a column using REGEXP


    Hi Forum,

    I have a table with a column that has records that contain one of the 3 words viz.

    TABLE X

    col1

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

    remit_method = EMAIL/remit_details = some other details

    remit_method = SMS/remit_details = some other details for sms

    remit_method = POST

    I need to write a SQL that captures the remit_method of the column. I wrote SQL using SUBSTR and INSTR to capture him. But I was wondering if I could do it using the functions of RegExp as well?

    SELECT REGEXP_SUBSTR (col1) == > how?

    Of

    (

    SELECT ' remit_method = EMAIL/remit_details = FROM DUAL some other details

    UNION

    SELECT ' remit_method = SMS/remit_details = some other details for FROM DUAL of sms

    UNION

    SELECT 'remit_method = POST' FROM DUAL

    ) ;


    Output must be

    1st row = > EMAIL

    Row2 = > SMS

    Row3 = > POST

    Thank you

    Maëlle

    Like this...

    SQL > ed
    A written file afiedt.buf

    1 with tablex as (SELECT ' remit_method = EMAIL/remit_details = col1 OF DOUBLE UNION some other details)
    2. SELECT ' remit_method = SMS/remit_details = some other details OF UNION of the sms for DOUBLE
    3. SELECT 'remit_method = POST' FROM DUAL
    4                 )
    5 SELECT REGEXP_REPLACE (col1, ' ^ remit_method =([[:alpha:]]+). * $', '\1') as remit_method
    REGEXP_REPLACE 6, (col1, ' ^. * remit_details =(.*) $ |. *', '\1') as remit_details
    7 * FROM tablex
    SQL > /.

    REMIT_METHOD REMIT_DETAILS
    -------------------- ----------------------------------------
    A few other details by E-MAIL
    Publish
    Other details for sms SMS

  • Field validation tab still enter data using regExp?

    Hello

    I use jdev 11.1.2.3

    I have a requirement on the field validation tab...

    I have a form that is not duplicate value accept value already existed DB table means so when back of the same value and tab on this high area error message (the code is already exist)

    How to achieve this can someone help me with the code...

    Thank you.

    The solution is given in my other post. Implement a valueChangeListener in your beans. In the listener method call an application module method that checks the new value that you get from the event. If the new value is already in the DB add a message of faces in the listener for changes in value and set the new value to the old value to avoid the false value is found in the user interface.

    Timo

  • How to use REGEXP to instruction box

    Hello everyone, I am brand new here and fight with a help of REGEXP in a case statement, OK I use the REGULAR expression to search for all the strings that correspond to a specific format for a particular brand of product, for example the serial numbers, and I have to be able to say something like [case when (xx.brandid) = '123' then if REGEXP_LIKE (xx.serialnumber xx.serialnumber , "[(A-za-z][A-za-z][A-za-z]\d{5,}[A-za-z]$') then"TRUE"else"FALSE"end ' TRUE/FALSE'.]".

    Help would be greatly appreciated with what I feel I'm back, trying to understand what

    Thanks in advance for any help.

    Like this?

    case

    When xx.brandid = '123' and

    REGEXP_LIKE (XX. SerialNumber,'[A-Za-z][A-Za-z][A-Za-z]\d{5,}[A-Za-z]$') then

    'TRUE '.

    on the other

    'FALSE '.

    end

  • Avoid using OR

    Hi guys, I just wanted to ask how I can avoid OR using statement? I read that they are not very precise and or best practices? I have a simple request like this:

    {code}

    Select

    T.account_num,

    T.account_date,

    T.account_cert,

    T.account_code

    OF Table T

    WHERE

    TRUNC (T.account_date) IS NOT NULL AND ((T.account_code IS NOT NULL OR T.account_cert IS NOT NULL))

    {code}

    I use a case statement instead? If so, how? Thank you

    Where did you read that? Can you post a link?

    You can use CASES, but I don't know if it will be better

    Select T.account_num

    T.account_date

    T.account_cert

    T.account_code

    OF Table T

    WHERE

    TRUNC (T.account_date) IS NOT NULL

    AND the case

    When T.account_code IS NOT NULL then 1

    When T.account_cert IS NOT null then 1

    end = 1

  • Avoid using the same query...

    How can I avoid to use the same query again and again using a single query, such as

    SELECT
    a,
    b * (SELECT COUNT (C1) FROM T2);
    c * (SELECT COUNT (C1) FROM T2);
    d * (SELECT COUNT (C1) FROM T2)
    Of
    T1;

    Fanny says:
    How can I avoid to use the same query again and again using a single query, such as

    SELECT
    a,
    b * (SELECT COUNT (C1) FROM T2);
    c * (SELECT COUNT (C1) FROM T2);
    d * (SELECT COUNT (C1) FROM T2)
    Of
    T1;

    A few cross join?

    select a, b*cnt, c*cnt, d*cnt
      from t1, (select count(c1) cnt from t2)
    
  • iOS10 avoiding using fingerprinting on the Lockscreen

    Not wanting to seem too "sheet of Tin-hat", but I have not being updated to iOS10 again and can not - if I am forced to give Apple my fingerprints.

    I've never used the footprint unlock the thing on my iPhone before, because I always felt that it was invasive to give Apple my data of fingerprints (as well as all my other personal info!)

    It seems that iOS10 is taking this choice by removing the slide to unlock - or am I wrong understand the change of internal screen lock.

    Can I still unlock my phone without the help of fingerprints with iOS10 information?

    Just press the button home and you'll be fine.

  • Blank CD or avoid use

    Does anyone have suggestions on what blank CD brands to buy or stay away from?  I read somewhere to avoid Memorex, are there any other.  I have TDK and have a problem.  I need to go out and buy new ones, but don't want to have a problem with them also.  Thanks for all the answers.


  • How to avoid using oracle.jdbc.driver.OracleConnection

    I am new to Java, but recently, I have a project on support.

    Problem:

    solution worked on the 1.4 jvm, now on 1.7.

    Respectively, the oracle.jdbc.driver.OracleConnection class has been used.

    Now, I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary (), but... I can't.

    According to the docs, just replace in the code and config files a declaration of the class on another. But I replaced all in all the files of configuration of no. and anyway, no there wasn't that oracle.jdbc.driver.OracleConnection was created. (there is no explicit declaration of the type of connection in the code, everything is configured in the config files)

    Project uses marven, mybatis - 3.1.1. Database: oracle 9

    Driver: ojdbc14 - 9.2.0.5.jar contains two classes: the oracle.jdbc.driver.OracleConnection (for backward compatibility) and oracle.jdbc.OracleConnection.

    The question is what do I need to use a second instead of the first.

    Maybe there are a few java cache? I do not know...

    Everyone knows?

    I solved the problem!

    This thread helped me: https://forums.oracle.com/thread/556426 ("I have to use classes12.zip for this work.")

    The main problem was the jdbc driver - I tried all the ones I found on the page of download of oracle and the only factor that does the job was classes12.jar (Oracle Database 10g Release 2 (10.2.0.1.0)). I replaced it in 'ORACLE_HOME\jdbc\lib\' and 'apache-tomcat\lib\.

    Each driver has its own bugs, and I also did different things, so I can't say that any replacement driver is enough. Te I changed the time zone database, run the tzupdater, vm set param - Duser.timezone = ""-07:00 ", may be something else."

    Thank you very much for the answer so detailed!

  • Exclusion list of VM using regexp

    I had problems with the vm_exclusion_list parameter.

    The example is that I have too many vm:

    foo

    foo2

    If I add foo2 vm_exclusion_list file, foo result is ignored.

    Crime line (643) reads as follows:

    grep-e "${VM_NAME}" "${VM_EXCLUSION_FILE}" > / dev/null 2 > & 1

    Not sure of the reason for the control of regexp there.

    I have some ideas for a fix, but curious to know the original intent.

    Thank you

    Ron

    Add ^ at the beginning and at $ at the end should solve the problem:

    [asx@f16asx tmp] $ cat re
    foo2

    [asx@f16asx tmp] $ grep 'foo' re e
    foo2
    [asx@f16asx tmp] $ grep-e "^ foo$" re

  • How to avoid using the library native ttJdbcCS when connecting to remote host?

    I'm testing the Java program with the product that limits the use of native libraries.
    I use the 'client' mode to connect to TimesTen DB (which is done by using the plug, not the shared memory).

    It seems that even in client mode TimesTen JDBC driver calls the library native ttJdbcCS when doing remote queries.
    Why it does not use Java sockets? What is necessary for the native library?
    Is it possible to eliminate the use of native libraries in client mode of the JDBC TimesTen driver somehow?

    I fear that it is not possible to eliminate the use of native code for TimesTen libraries. Both direct drivers and customer are drivers of type 1 (JDBC/ODBC bridge). In both cases the JDBC driver Java code called NYI optimization library ttJdbc/ttJdbcCS and that the library in the direct or client ODBC driver (also called native code).

    If you want to use TimesTen then you must be able to allow the use of these native code libraries. The only other alternative is to implement your own client/server mehcanism such that you can put your own component 'server' on the machine running TimesTen and then use pure Java to communicate with this component of the 'customer '. Generally, it is however a lot of work.

    Chris

  • Find several occurrence of a dynamic string using RegExp?

    I need to find multiple instances (there can only be one) of a dynamic text. For example

    var searchForThis:String = 'hi. '

    var regEx: RegExp = \b/searchForThis/\b

    The above does actually not compile and if I remove the two \b he actually seek the word searchForThis and not salvation.

    (1) how can I configure RegExp to search for a word not only a substring that is dynamic and can find multiple occurrences as well as the index at the beginning of each event?   So, if I had the string "Hi there by there salvation once again. Where is the road"he would find two matches. He wouldn't understand road because this salvation is just a substring. I would be looking for the words

    With the next component, I find the three games in the list when I click the button of "game". It does not give you the match index, even if - depending on what you plan to do, String.replace () could work (the replacement of the game can be a string or a function that is passed to a certain number of arguments, including the index of matches).


    http://www.Adobe.com/2006/mxml"width ="400"height ="300">
       
            private var v: String = "Hi there by there Hi there Jake."
    private var re: RegExp = new RegExp ("Hi", "g");
               
    private void handleClick(e:Event):void {}
    var matches: Array = v.match (re);
    matchList.dataProvider = matches;
    }
               
    ]]>
       

       
       

Maybe you are looking for

  • How can I make thunderbird use firefox?

    I went to the control panel and made FireFox my default and tried everything I could find on the internet to make the default for FireFox to Thunderbird, but Thunderbird is still using IE 8. How can I fix?

  • Photosmart 6510 e - All - In - One: Photosmart 6510 does not print black clearly

    My printer prints everything but black clearly; I put in a new cartridge and run the head cleaning nothing works. Is it possible to clean the head for black to hand? Help! I have things that I need to print!

  • Battery change.

    Hi, I'm Alessandro and I'm almost crazy with a very simple thing! Where can I buy a new battery for my Entertainment laptop HP Pavilion dv6-1350sl Model: VS037EA He's old enough, I bought in 2009. But it works fine (for my use!) and I would just repl

  • HP HDX16: what does an infrared receiver?

    I changed from VISTA to Win 8.1 and I received a message that my infrared receiver must be updated and I could upload it somewhere. WHAT is ENE CIR for? What do I do or does not? Thank you very much. Sorry for my ignorance...

  • Narrator to read a screen

    I'm trying to use Narrator to read a screen in Internet Explorer. However, when I have a text and then press Shift + Ctrl + space, nothing happens. If a different writer is necessary, others recommended? Free?