Extract only 2nd value

Hello

I want to extract only 2nd value of col2 that holds the values of semicolons.

When I try his failure to appear as expected.

Table

col1 col2

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

A cod; MOD; KL

B; DF

C ss; 6; 7

D gg

Expected results:

col1 col2

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

A mod

B               df

C

D

My test:

with

a trial in

(select 'A' col1, col2 "cod;) MOD; KL' Union double all the

Select 'B ', '; '. df"of the double

Union of all the

Select 'C', "ss; 6; 7' of the double

Union of all the

Select would be ', 'gg' of the double

)

Select col1,

NULLIF (regexp_substr (NVL(col2,'~'), "[^;]")) +', 1, 1),'~ ') col2

of the test;

I get:

col1 col2

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

A mod

B               df

C               ss

D               gg

Any help will be appreciated.

Thank you

Hello

You can also use regular expressions to get the N-th section, like this

REGEXP_SUBSTR (col2

, '([^;] *)(;|$)'

1

N - whole, to 1 or greater

NULL

1

)

SUBSTR and INSTR will be faster, however.

Tags: Database

Similar Questions

  • need to "extract" a numerical value of the given XML node

    My question: -.
    of a document XML how can I 'extract' a numeric value for use in a "customized math expression" to convert inches into millimetres/centimetres dimensional data?

    FYI: -.
    When you use a component XML Connector that I am able to load and display the values of XML data, of my choice, the XML document required; the data is loaded into the components that are instances of TextArea or TextInput.

    background: -.
    in order to make use of the value of XML data I tried to assign it to an 'intermediate and temporary variable' using the ComponentInstanceName.text option in an assignment, but that effort failed, where this post.

    your comments: -.
    all comments, suggestions, ideas are received with gratitude; Please keep in mind that cindy I am a newb to XML format, but hope that change in the coming months.

    Thanks for your time.

    ... and so, I discovered that the main reason for my bad be able to access the data is due to the fact that the xml data is not fully charged in my application when my code is trying to access. of course it's because of the asynchronous loading of the Flash XML Connector component behavior.

    so the repair to the original message is:-
    check that the data is fully loaded into the app and only then access and assign it to all the other required variables.

    SORTING :)

  • formatting of scale to display only integer values

    I'm trying to simply display a graph that has the integer values only and therfore that only integer values appears in the balance to alleviate the congestion of the eye on the chart.  Someone knows how this fundamental?

    If wire you an integer to the graphic terminal data type it should change the entire representation and take care of the problem.

    You can also set numbers of precision in graph to zero properties.

    Lynn

  • Show only distinct values in narrative mode

    Hi guys!

    Here again, we are trying to reach an ambitious goal.

    It is possible to show only distinct values in a narrative view? For example, I have a query that retrieves about 100 lines. In these lines, a few different years, it is something like this:

    1-2013, Jhon, 10

    2-2013, Brian, 15

    3-2013, Pete, 20

    ...

    10-2014, Steve. 5

    11-2014, Kevin, 12

    ...

    90-2015, Ray, 24

    91-2015, Michael, 2

    ...

    It is possible a mode display narrative only something like that?

    Years: 2013, 2014, 2015

    If I use the feature number @column, I get as many years the results are retrieved. It is not user friendly.

    Any help will be appreciated.

    Best regards

    Fabian

    Hi all!

    I found my own solution and I want to share with you. Maybe it helps someone in the future.

    I used JavaScript to iterate through each row value. By each line, I'll check if it value is added to the overall picture with unique values. If not added, I add it, otherwise, I do nothing.

    Here is my script (pay attention to each code block, it must be in its proper "narrative class"):

    Narrative section prefix

  • How to extract the string values

    Hello

    Database: 11.2.0.3.0

    I have a JSON string like below. I want to extract only the propetyvalues. Can you help me with the query:

    {

    'documents':]

    {

    'document':]

    {

    'propertyname': 'Id',

    'propertyvalue': "{1C236CB2-AB97-4982-8117-DE0BE6D7DB46}".

    }

    ]

    },

    {

    'document':]

    {

    'propertyname': 'Id',

    'propertyvalue': "{1318AC90-C321-4D3D-9558-6547EFE49A7E}".

    }

    ]

    }

    ]

    }

    Hello

    Too bad, that you do not have version 12. Then, you can use the function JSON_VALUE mentioned previously.

    Here's something you can do in your version:

    SELECT LEVEL AS n

    , REGEXP_SUBSTR (: str)

    , ' "propertyvalue": "([^"]*) "

    1

    LEVEL

    NULL

    1

    ) AS propertyvalue

    OF the double

    CONNECT BY LEVEL<= regexp_count="" (:str,="">

    ;

    If you want to know that adapts to your specific problem, post CREATE TABLE and INSERT statements for some sample data and the exact results you want from these sample data.

  • Show only the value not save to the database based on the dynamic action

    Nice day
    I have a select box with products and dynamic action that updates a single display element with the price, based on the selection of products.
    Once the selection is made and the page is submitted, I noticed that the price is not stored in the database. If I change the display
    only the value of a text box, the data is saved. This is expected behavior? If so, can I add something to the text box to make it uneditable?

    Thanks for any help you can provide.

    Version is Application Express 4.1.1.00.23

    Steve

    stmontgo wrote:
    Hello
    Thanks for your advice. I changed the STATE of SESSION SAVE Yes with the other values remains the same, as they met to your recommendations.
    When I change the value, I get the error below. It's maybe because the value is taken from a dynamic action?

    Yes. That would mean there isn't an item "view only". The value is changed by the browser.

    You might change view as textitem and set read-only by adding the ReadOnly attribute to the property attributes of HTML form elements .

  • Extract parts of value date Selected DateField

    Hi people,

    I would like to extract the part of the year of the value selected from my datefiedl.

    For example, I would get 2010 from: 23/12/2010

    And check if the extracted year is less than the current year.

    How can I do in LiveCycle (JavaScript is better)?

    Thank you

    Yair

    var Input = Num2Date (Date2Num ($.formattedValue, JJ.)) (("" MM. YYYY '), 'YYYY')

    Var Num2Date = (date (), "YYYY")

    If (input only those) then

    xfa.host.messageBox ("bad year")

    endif

    radzmar

    http://thelivecycle.blogspot.com/

  • Extract only the digit that starts the chain of txt

    Hello LabVIEW community. IM starting programming in LabVIEW and I stuck with one problem.

    IM creating weather station that send a txt file measurments.

    I just want open created by terminal .txt or .log file, draw different graphs of txt.

    journal and vi as an attachment file.

    Can I change the display size in the logfile (change separator), but always it will be mixed in a single file.

    Anyone know how to extract file only for example. all dimensions of moisture?

    I created vi that open and draw but still a problem of mesurment choose who I want.

    Sorry for my bad English

    If you want to use read the spreadsheet file, you write the data to a format that it can understand.  This usually means a tab-delimited text files.

    I recommend that you show us your code, locate the file where you write.  We can make life a lot easier on you by fixing that.

    In general what you want here is a line with headers (to indicate what are the names of channel), then data.  Each column of data belongs to a specific channel.  Each column is separated by a tab CHARACTER.  A new line in the file for each new data point for all channels.  If your newspaper should really resemble the home.

    So now, just remove the header information, and then string array spreadsheet to activate all the data in a 2D double table.  You can use then just Board Index to get the channel data that you care.

  • Where can I get directions to EXTRACT only the audio of a DVD with Windows Media Player v11

    Have investigated this question on the NET and seen various solutions (freeware), but I have just started using WMP to migrate my CD music in MP3 format.

    I have some great DVD rip also I want. Any direction is appreciated!

    Hi PEL7176,

    Windows media player only supports the extraction of CD and DVD not.

    You may need to use a third-party software to perform this procedure.

    NOTE: Microsoft cannot guarantee that problems resulting from the use of third-party software can be resolved. Software using third party is at your own risk.

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Shuttle sends only a value after submit

    Hello world!

    I have a shuttle, and I use it to query in a table. The user, it is supposed to pick different sum of the values of this element, then press a button to view the results. I am a shipment on the same page, sending the value of the element through a branch to himself. : - > P100_SHUTTLELIST & P100_SHUTTLELIST.

    APEX worm: 4.2.2

    I hope you can help me!

    -Fury

    I was using "Source" as "always, replacement..." I would like to change it to "Only when the current data in the session of the State are zero" and now it works!

    Thank you!

  • [11g] ORA-22993 when extracted xmltype great values in the outbreak of the BIU as a CLOB in another table

    [I ask nicely for a few comments for this question.

    Someone else can reproduce it with the test below?

    Is my code invalid or false?

    Or what is the problem here?

    -Thank you

    Frank

    ]

    Hello

    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 Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Trigger Before Insert or Update to a table, I invoke a PL/SQL package function to check the size of an xmltype column (passing as IN OUT NOCOPY).

    PL/SQL functions retrieves the xmltype. GetClobVal(), check its size, and when it is beyond a limit, he tries to insert the data into another table (GTT - global temporary table).

    Finally, it changes the value of the value of the column of xmltype to the shorter XML (just by referring to the corresponding record in the TWG).

    But the Insert SQL in the TWG operation strike ORA-22993: specified input is greater than the amount actual source.

    I don't know why this happens. In the internet I only find references on importing files in lob/clob.

    Anyone have the same problem?

    I know that you prefer to have a sample program to demonstrate the problem - I'll try to post one, but it will take time.

    But maybe someone can help me based on the information above already.

    -Thanks a lot!

    Best regards

    Frank

    I have reproduced the issue.

    It must be a bug.

  • Extract only last page of the PDF - batch document

    Hello

    I need to extract the last page of about 100 documents in a batch process.  I need only the last page, and the number of pages in each document varies (i.e. can be 30, it could be 200).

    Is it possible to do this without having to enter each document and extracting the last page?

    On discussion forums, I found a javascript script to enter the Action Wizard, allowing you to delete the last page, but not to extract it or remove the pages in front of her.

    Thank you!

    No, you can't do it. You cannot replace a file with a file you are currently editing.

    What you can do, however, is to remove all other pages of the file, and then save it under the same name.

    To delete all the pages, but the last, you can use this code:

    this.deletePages (0, this.numPages - 2);

    Then just add a step to Save your action and you're done.

    Just keep in mind that this process is NOT reversible. Then maybe make a backup of your files before you run it.

  • Feed the list component with labels that have only certain values.

    I have to be able to sort out shorter labels in the component 'listHolder.list' by values in 'Fan', 'Herdighet', etc., which will be selected of the other items in the list
    (those who do not need to be fed by XML, but the list items own dataProvider)

    Practical example: displays only the labels in listHolder.list that are connected to the "H1" value in "Herdighet" or "H2" "Herdighet" etc.

    I am fairly new to AS3, so I do not know how to start. I appreciate everything you can give clues.

    Here's the code so far:

    //--------------------------

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    listHolder.list. addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void {}

    var selectedObj:Object = a [listHolder.listSelectedIndex]

    var xml;

    var a: Array = [];

    function onLoaded(e:Event):void {}

    XML = new XML (e.target.data);

    var it: XMLList = xml. Lauvtre;

    for (var i: uint = 0; i < il.length (); i ++) {}

    listHolder.list.addItem ({.child('Botanisk_navn').toString ()label: it [i]+ "\n"+ "-" + it [i].child('Norsk_navn').toString () "});

    a [i] = {'Fan': it [i].child('Farge').toString (), 'Herdighet': it [i].child('Herdighet').toString (),}

    "Høyde": he [i].child('hoyde').tostring (), "Botanisk_navn": he [i] .one ('Botanisk_n avn') m:System.NET.SocketAddress.ToString (),.

    'Norsk_navn': it [i].child('Norsk_navn').toString (), 'Image': it [i] .child ('image'). toString(),

    {"Blomstring": he [i].child('Blomstring').toString (), "Lysforhold": he [i] .one ('Lily book') m:System.NET.SocketAddress.ToString ()};

    }

    }

    Loader.Load (new URLRequest ("lauvtre.xml"));

    Fusion is a good thing.  The more you have to understand this, easy it all comes together when the lights start to go.

    In regard to the 'a' table... If you look at how values are it is attributed originally, they are attributed to the 'i' value of the index.  So, if the first element that passes the test of H1/H2 is the 10th 'i', it means that 10 of the table value is assigned to the first value you found.  The first 9 values in the table are zero as a result.

    But if you use the method push of the array class.

    a.push ({"Fan": he [i].child('Farge').toString (),... etc...});

    then the item is added to the index of the table rather than the 'i' the next clue.  If a table will have the same number of elements as the list and the list and table will agree in regard to pair them up.

  • Extract all numerical values of &gt; = 10 length

    Hi all

    I have a table named "STS_HISTORY".
    in which I have 2 fields
    Number STSID
    History varchar2 (4000)

    I need to create another table that has 2 fields
    stsid, mynum
    where stsid is the same from the table of sts_history
    and mynum will contain the numerical value of > = length 10.

    for example
    will he be stsid: 1 the history field is
    "123456789 1234567890 here 12345678901 123456789012 1234567890123 data please 12345678901234 seprate 1'
    You must then put

    1 1234567890
    1 12345678901
    1 123456789012
    1 1234567890123
    1 123456789012345

    is there way to sm to do using only does not xmltable

    of course there are:

    SQL> with sts_history as (
     select 1 stsid, '123456789 here 1234567890 is 12345678901 some 123456789012 data 1234567890123 plz 12345678901234 seprate 1' history from dual union all
     select 2 stsid, '123456789 here 1234567890 is 12345678901 some 123456789012 data 1234567890123 plz 12345678901234 seprate 1' history from dual
    )
    --
    --
    select stsid, regexp_substr (history, '\w+', 1, level) history
      from sts_history
     where rtrim (regexp_substr (history, '\w+', 1, level), '0123456789') is null
           and length (regexp_substr (history, '\w+', 1, level)) >= 10
    connect by     level <= length (history) - length (replace (history, ' '))
               and prior stsid = stsid
               and prior sys_guid () is not null
    /
              STSID HISTORY
    --------------- ---------------
                  1 1234567890
                  1 12345678901
                  1 123456789012
                  1 1234567890123
                  1 12345678901234
                  2 1234567890
                  2 12345678901
                  2 123456789012
                  2 1234567890123
                  2 12345678901234 
    
    10 rows selected.
    
  • extract only some characters of a coloumn

    the chain of value in coloumn ERROR_ROW (the field name is ERROR_ROW)

    Salesperson code: RFD, product code: GLU 065405: BT, date of invoice: 16 March 09, the invoice No.: 41001418, quantity: 3, price: 13.49, amount: 40.47, distributor HIN: G74LA4Q00, HIN client: AHW6WQF00, Source: SS, REF ID from: 35950268, HIN warehouses: KE12PF500, Trans line no: 4436, Bill: 211907, ship to: AHW6WQF00, identifier of sales: 21, Zip: 45133

    I have a thousand rows in this table

    Using SQL

    I want to extract the values of the XXXXXXX (abouve example 41001418)
    in the example charactors between invoice No.: XXXXXXX, * amount *.

    These characters between "Invoice number" and "Quantity" must be extracted from all lines

    Note: the value of
    vendor code
    product code
    UNIT OF MEASURE
    Its value will vary

    Thanks in advance
    MAh

    NOT TESTED

    substr(error_row,
           instr(error_row,'Invoice no:') + 12,
           instr(error_row,',',instr(error_row,'Invoice no:'),1) - instr(error_row,'Invoice no:') - 12)
          ) 
    

    Concerning

    Etbin

    Assume that "quantity:' does not always follow ' invoice No. :'-> looking for the first comma after" invoice No.:'

    Edited by: Etbin on 26.6.2009 18:07

Maybe you are looking for

  • Resizing windows

    Hello I'm looking for a way to resize the window programmatically. I used the function dependent ON the property node and I can read the size of windows, but unfortunately I can not write anything in this property. Also I tried a few others, but stil

  • Lost apps and singing and games on I phone4

    Accidentally reset factory settings on my I phone4 while trying to trade tips between phone and laptop. I wonder how too get by them? There was a lot of money down the drain, I thought? I hope not? :-)

  • where can I find a generic XP Home or teacher OS disc?

    Son of an old friend has an office generic self-build with XP Professional, he received from a friend of the family who died.  It works fine until recently, all programs stopped working.  Start the computer, but none of the application programs will

  • connection to server failed Error 0x800CCC0E

    The connection to the server has failed. Account: 'mail.q.com', server: 'mail.q.com', Protocol: POP3, Port: 587, secure (SSL): Yes, Socket error: 10060, error number: 0x800CCC0E

  • Cruzer Fit - included files

    Hello Just bought one of these Fit USB Cruzer flash drives and initially, I want to put a top lightweight linux distro to work with my PC bios.  However, I see that this player comes with the following files and would like to know please if I copy th