Extract the value after the period

Hello

I am trying to extract the value from each period.

I have the table data is stored in this mode 172.168.15.10, which is an IP address,.


My requirement is I need to first value in a query with must return 172
If I need the value after the second period, it should return 168


Please suggest me how to write a SQL for the above requirement and oracle 11i Enterprise edition as the database.


Thank you
Sudhir

with regexp

select
  regexp_substr('172.168.15.10', '\d+', 1, :pos) s
from dual

without regexp

select
  substr(s
        , instr(s, '.', 1, :pos) +1
        , instr(s, '.', 1, :pos + 1) - instr(s, '.', 1, :pos) -1
  ) s
from (select '.'||'172.168.15.10'||'.'
 s  from dual)

Edited by: chris227 the 01.10.2012 01:23

Tags: Database

Similar Questions

  • The render after timeout period value

    I wonder if there is a way to launch a full after a period of inactivity. Body may start a complete record for all unreturned sections on all the sequences in the timeline?

    This will help you in when I leave my Gallery for an hour, I can start 1 to render sequence that will take 5 minutes, and I hope that the other sequences begin self-made by themselves in the other 50 minutes.

    Thank you in advance for any for any input.

    -Charlie-

    FYI: this post is also on Creative Cow forums. If I get a response here, I will be sure to cross-post. Thank you.

    Well, let - instead of ask background rendering, how about we ask NO rendering. What MPE, particularly the variety accelerated by GPU, it is all about. Many things in Premiere Pro are already accelerated, but I do not think we are satisfied until all processes are in real time and don't require none of all rendered.

    Now, it's a feature request

  • change password after expiry of the period of loging?

    Hi to all the experts:

    How to change the password at the end of the period? And it gives the message the user please change your password, please guide me how to do it please help me if anyone wants to help me?
    Here is an example.

    example:

    step 1 old password

    Step2: new password

    Step 3 confirm password

    Thanks in advance
    Sarah

    Published by: user652484 on August 7, 2009 22:44

    Published by: user652484 on August 8, 2009 01:58

    First of all, you certainly don't want to store the password of the user in your table. Secondly, you need to store the user_id uppercase when you insert data, so your entry should look like:

    insert into user1 (USER_ID, PASSWORD_CHANGE) values ('SARA',to_date('09/08/2009','dd/mm/yyyy');
    

    Now, after the user logged in with your connection dialog box, check the date as password:

    DECLARE
      CURSOR cr IS
        SELECT ADD_MONTHS(PASSWORD_CHANGE, 1)
          FROM USER1
         WHERE USER_ID=USER;
      dtPasswordExpire DATE;
    BEGIN
      OPEN cr;
      FETCH cr INTO dtPasswordExpire;
      IF cr%NOTFOUND THEN
        -- error, user is not in the user-table
        -- do whatever you want
      END IF;
      CLOSE cr;
      IF dtPasswordExpire>SYSDATE THEN
        -- password expired, show your password-change-dialog
      END IF;
    END;
    
  • Measure the period and the peak value at crest of a sine wave

    Hello

    I am new to Veristand and Labview and I was wondering if there is the possibility to do the following:

    I would like to measure the period of a sine wave that I capture from analog input of my data acquisition (SMU-6363). Apart from that, I also want to measure the value of crete to crete (Vpp) of the sine wave.

    I hope you can help out me.

    Thank you.

    If the sine wave is of significantly higher frequency than the primary control loop can run... The best way to do it would be to put the DAQ hardware in waveform input mode and use a custom device to read the waveform and perform analyses.

    an example is here: requires some labview skills

    \examples\NI VeriStand\Custom analysis Devices\waveform

  • Display disappears after the period of non-use. The display is fine (a plasma), the computer is running. But no display and must restart.

    Hi-for no apparent reason, the computer has developed the following: after a period of non-use (always on computer), when I re - turn on the monitor I get a black screen.  Using the mouse, knocking every possible key produces no image on the monitor.  Meanwhile, the hard drive is very hard.  Only the appeal should restart.  Any ideas?

    As I said it's a guess.

    Let us know if find you the solution.

  • Desktop Windows 7 goes black after a period of inactivity and the user accesses their machine again

    Hello

    Wonder if anyone can offer help for an unusual problem?

    Users have Windows 7 machines that all have a background theme to display... Blue with a company Logo.

    User's for lunch and leave their posts after a period of time and/or powersaver screensaver comes in... all normal at this stage.

    After an hour, they return to their machine and they move the mouse/tap a key and bring the machine back (excuse my terminology :)) and the office went from the default theme for a black desktop computer... Icons/Applications behave very well.

    The temporary workaround is:

    1. open a session and on windows to restore the office back to normal.

    or...

    2. I do a restart of the "Desktop window Manager Session Manager" service that puts the office back to normal as well.

    Has anyone seen cela and worked a way how to make a permanent fix... have struggled on Google because the answers I find are around the screen savers that ISN'T the problem.

    See you soon,.

    Steve

    Hi Steve,.

    Thank you for the update. However, since these computers are connected to the domain, your question is beyond the scope of what is generally answered in this forum of consumer and would be better suited for the IT Pro TechNet public.

    Please post your question in the TechNet Forums.

  • On Windows 7, how to implementing automatic uppercase the first letter of the first book and the first letter after each period?

    I'm using Windows 7, how do I configure my system automatically capitalized the first letter of the first word and the first letter after each period?

    Thank you

    Lisa.

    Hello Lisa,.

    It's more to do with the word processor on Windows. You don't say what word processing software you use. If you use WordPad which comes free with Windows, it is impossible to do what you want to do. However, if you are using Microsoft Office Word (that you can buy) then the CAP is set by default.

    This forum post is my own opinion and does not necessarily reflect the opinion or the opinion of Microsoft, its employees or other MVPS.

    John Barnett MVP: Windows XP Expert associated with: Windows Expert - consumer: www.winuser.co.uk | vistasupport.mvps.org | xphelpandsupport.mvps.org | www.silversurfer-Guide.com

  • values based on the following logic 'values after the first values of two '_' and before last '_' values '.

    Hi all

    I need the values according to below 2logics in a single select query using instring and substring

    1 values based on the following logic 'values after the first values of two '_' and before last '_' values '.

    2 values based on the following logic 'values after the first values of two '_' and before last'-'values '.

    EXM:

    Entry: ABCD_EFGH_IJKLM - NOPQ_XYZ output: IJKLM - NOPQ

    Entry:. ABCD_EFGH_IJKLM - NOPQ output:IJKLM

    Thank you.

    Check the following

    WITH DATA1 AS

    (SELECT "ABCD_EFGH_IJKLM - NOPQ_XYZ" double val)

    UNION ALL

    SELECT 'ABCD_EFGH_IJKLM - NOPQ' double val

    )

    SELECT SUBSTR (VAL, INSTR(VAL,'_',1,2) + 1, DECODE (BIGGER (INSTR (VAL, '_',-1, 1), INSTR(VAL,'-',-1,1)), INSTR (VAL,'-', - 1, 1), LENGTH (VAL) + 1, INSTR (VAL, '_',-1, 1))-(INSTR (VAL, '_', 1, 2) + 1))

    OF DATA1;

    Concerning

    Salim

  • extract the value between the _ or until the end

    Hello

    I was trying to extract a value from format using regexp_substr below. But I don't know how to use the REGEXP_SUBSTR for this. Can someone please help on this.

    STRING

    ORACLE_TECHNOLOGY

    ORACLE_TECHNOLOGY_NETWORK

    ORACLE_TECHNOLOGY_NETWORK_INDIA

    output:

    TECHNOLOGY

    So, what can be the input string, the output should be the string between the 1st and 2nd underscore (_). If missing the 2nd terms underscore (_), then it should give to the end.

    My version of oracle's 11g.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    "CORE 11.2.0.3.0 Production."

    AMT for 64-bit Windows: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    regexp_substr (String, ' _ ([^ _] *)(_|$)', 1, 1, null, 1)

    or

    substr (String, instr (string, '_') + 1, decode (instr (string, '_', 1, 2), 0, Length - instr (string, '_', 1, 2), instr (string, '_', 1, 2) - instr (string, '_', 1, 1) - 1))

  • try to extract the files after downloading a program, the error message

    Cs6 Adobe Creative Suite Design & Web Premium. have downloaded successfully, and when I go to "Run" and extract the files and save it in a folder it tells me to

    "check the rights in writing on the destination folder or the space on my computer. I just wiped my computer and there defiantly of the space. I don't know what the 'writing' is. I'm on the administrator account for the computer, I had this specific programs on this computer before I wiped it and last time I have had no problem download of this. Also this message comes after the first message,

    error.png

    Any ideas?

    Run all programs as Administrator http://forums.adobe.com/thread/969395 to assign FULL... Permissions said yet, but it is sometimes necessary for Adobe

  • Extraction of values within the brackets():


    Hello

    Please, help me to overcome this problem.

    I want to extract the value inside the caliper.

    example:

    place (Chennai.Mumbai, Delhi)

    I want inside the support value which is chennai.mumbai, delhi.

    I used replace Regualr expression but I can't.

    Thank you

    Elayaperumal

    SQL > t
    2 as
    (3)
    4. Select 'place (chennai.mumbai, delhi)' str
    5 double
    6)
    7 select substr (str, instr (str, ' ('), instr (str, ' ') ' ' ')-instr (str, ' (()) + 1) method_1)
    8, regexp_substr (str, ' \([^)] +-)', 1, 1) method_2
    9, regexp_replace (str, ' ([^ ()] +) (\([^)] +)', "\2") method_3
    10 t;

    METHOD_1 METHOD_2 METHOD_3
    ---------------------- ---------------------- ----------------------
    (chennai.mumbai, delhi) (chennai.mumbai, delhi) (chennai.mumbai, delhi)

    SQL >

  • Extract the value

    Hi all

    I have data as in the table below and I need to extract the data between the chain of the FONTS.

    String:

    < a href = JavaScript:viewlink_function('Fastform?id=101279&proc=6627&edit_flag=Y&wrapper=no&emd=3') >

    < DO color = #0000FF > AST-000143 < / POLICE > < / a >

    Value of production: AST-000143

    Thank you

    Hello

    Try with SUBSTR and INSTR like below:

    WITH t (str)

    AS

    (

    Q SELECT ' {}

    "(Wrapper = no & emd = 3') >AST-000143}"

    OF THE DOUBLE

    )

    SELECT SUBSTR ( )

    SUBSTR (STR, INSTR (STR, e<><>

    , INSTR (SUBSTR (STR, INSTR (STR,'<>', 1) + 1 ))

    ) T STR;

    OUTPUT:

    STR

    ----------

    AST-000143

  • How im can extract the value of the persistence of virtual machine disk?

    Dear friends

    How im can extract the value of the value of the persistence of disks of virtual machines?

    IM using the bellows of the order, I have a if to check if the disks are independent or not

    but im only want values of the persistence of the column to use in my script

    Get-disk hard - vm machine01

    CapacityGB persistence Filename

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

    10 000 persistent [LUN2] RJ7469SR039/RJ7469SR039.vmdk

    8 000 persistent [rate2] RJ7469SR039/RJ7469SR039_1.vmdk

    Thank you

    Almir

    In your example, you just use Select-Object

    Get-disk hard - vm machine01 | Select the Parent, persistence

    The parent is the name of the virtual machine

  • Process of calculation to calculate the value after submit after all validations

    Hello

    Please help with a possible approach or suggestions for the calculation process.

    I have a calculation process after submit I want to calculate its value after that all validations are handled. Because this process of calculating trim is off of the first part of the input string of the user for the P3_USES element. Thus, for example consider; the user selects a value for P3_USES (point list manager) to be "TAC"... BCA... BCA... BCA... 0.CA BC... "CA IT BC. So my calculation process just stripes off the coast of the first portion of the string and computes the value will be "BCA"... BCA... BCA... 0.CA BC... "CA IT BC. It works fine when all postings on the page are placed without cooking.

    The problem occurs, then the validation fails on the form. Once the validation fails, the calculation process; already calculates the value and the P3_USES value form element is set to "BCA"... BCA... BCA... 0.CA BC... "CA IT BC. So, here the user solves the problem of validation and sends it again the form, but at this point the value is calculated again but this time that my string is "BCA"... BCA... BCA... 0.CA BC... CA IT BC"which is not correct, because my initial user string entry was"TAC"... BCA... BCA... BCA... 0.CA BC... "CA IT BC.

    So my question is how they treat the value of my calculation after all validations. While I can keep the original value of the P3_USES element. I'm using the version of Oracle APEX 4.0 and Oracle 10 g R2 database.

    Thank you

    Rambeau

    Hello

    Combine code of calculation and validation?

    Perform the calculations in the process?

    Use another element to contain the value 'real '?

    Kind regards

    Jari

  • Extract the character after a certain expression

    Hi here how is the source string

    string_1string_A
    string_2_Bstring
    string_2_X_1
    string_3
    string1

    I wan to extract the first character and the next character after that all occurrences of "_" as below

    s1A
    S2B
    s2x1
    S3
    s

    Thank you
    Srini

    Srini Ramaswamy wrote:
    Thank you, but the number of occurrence of "_" is not fixed - can we have it dynamically?

    with t as (
               select 'string_1string_A' str from dual union all
               select 'string_2_Bstring' from dual union all
               select 'string_2_X_1' from dual union all
               select 'string_3' from dual union all
               select 'string1' from dual
              )
    select  str,
            regexp_replace(str,'(^|_)(.)[^_]*','\2') new_str
      from  t
    /
    
    STR              NEW_STR
    ---------------- -------
    string_1string_A s1A
    string_2_Bstring s2B
    string_2_X_1     s2X1
    string_3         s3
    string1          s
    
    SQL>
    

    SY.

Maybe you are looking for