Extract amt value chain

Hello

I need to extract the amount of chain. I have achieved this goal by using substr and replace the function. I want to use regular expressions. can you please help me to use regular expressions.

SQL > with b as (select "MS % 3 %% 1492% ' union str double all the")

2. Select 'CC%%%3%%1827.00%%%CA%%' from dual union all

3 select "MS % 5% ' Union double all the»

4 Select "CA 3 1893.96% ' Union double all the"

5 Select ' CC 3 12994.46 AX 37601 * 1021% ' of the double

6)

7 select * b

8.

STR

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

MS % 3 %% 1492%.

CC%%%3%%1827.00%%%CA%%

MS%%%%%%%%5%%%%%%%%%%%%%%%%%%

CA 3 1893.96%.

CC 3 12994.46 AX 37601 * 1021%.


Expected results:


AMT

--------

1492

1827.00

Null value

1893.96

12994.46


Concerning

Ravikumar.A

babaravi wrote:

Thanks for your help. It works very well. with the exception of one of the scenarios.

SQL > ed

A written file afiedt.buf

1 with b as (select "MS % 3 %% 1492% 899% ' union str double all the")

2. Select 'CC%%%3%%1827.00%%%CA%%' from dual union all

3 select "MS % 5% ' Union double all the»

4 Select "CA 3 1893.96% ' Union double all the"

5 Select ' CC 3 12994.46 AX 37601 * 1021% ' Union double all the

6 select ' CC 3 AX 37601 * 1021% ' of the double

7)

8 select str, REGEXP_SUBSTR (str,'\d\d+\. * \d *') amt

9 * b

SQL > /.

STR                                                                   AMT

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

MS%%%%%%%%3%%1492%%%%%899%%%%                                         1492

CC%%%3%%1827.00%%%CA%% 1827.00

MS%%%%%%%%5%%%%%%%%%%%%%%%%%%

CA        3  1893.96                    %%%%                          1893.96

CC 3 12994.46 AX 37601 * 1021% 12994.46

CC 3 AX 37601 * 1021% 37601 - this must be null because the value '3' and 'AX' is null.

6 selected lines.

Elapsed time: 00:00:00.03

SQL >

Ah, ok, probably so...

SQL > ed
A written file afiedt.buf

1 with b as (select "MS % 3 %% 1492% ' union str double all the")
2. Select 'CC%%%3%%1827.00%%%CA%%' from dual union all
3 select "MS % 5% ' Union double all the»
4 Select "CA 3 1893.96% ' Union double all the"


5 Select ' CC 3 12994.46 AX 37601 * 1021% ' Union double all the
6 select ' CC 3 AX 37601 * 1021% ' of the double
7    )
8  --
9 select regexp_replace (str, ' (^ [^ 0-9] *?)) [ 0-9] + [^ A-Z] * ? ([0-9.]+).*$|.)','\2']) as val
10 * b
SQL > /.

VAL
----------------------------------------------------------------------------------------------------------
1492
1827.00

1893.96
12994.46

6 selected lines.

Tags: Database

Similar Questions

  • 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))

  • Is it you please, how to pour extract a value of a 2D array?

    Greetings,

    Is it you please, how to pour extract a value of a 2D array?

    Thanks in advance.

    Just use the Index Array function. Specify a line and column, and you'll get one.

  • How to extract individual values of TCP packet?

    Hi all!

    IM facing a situation where I have to extract individual values to insert into a sql database.

    IM sucessfully receiving the package and I need to insert values lie between {xxxxxxxxxxxxxxxx}, each value name (column name) is bounded between "xxxxxxxx" and also its value.

    IM - sticking the received packet:

    {'Address': '0xC800A8C0', 'Channel': 0, 'Description': 'DDNS', 'Event': "Update", "SerialID": "000b3d016ce3", "StartTime": "2011-12-01 20:04:51", 'Status': 'Start', 'Type': "Journal" ""}

    How can I retrieve the column names and values of the string received?

    for example: "Address": "0cC800A8C0" - the name of the column is address and the value is 0cC800A8C0, etc., etc. each field is separated by a "," and each row is enclosed between {}

    I need to insert only 0cC800A8C0 in the address column (and other values), but without "" and without:... Please note that the channel: 0, a value of 0 is not "" because it is a numeric value, the rest are strings.

    any help on this?

    Thanks in advance!

    You can go there.

  • 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 >

  • 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

  • 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

  • Extract specific values of XML (Oracle 11)

    Hello
    First of all... Please excuse my English... I'm Belgian ;)

    I have a 'Messages' table in Oracle 11, with a "xml_request" of type XMLTYPE field. Say that it contains the following data (sorry for the formatting, couldn't help it).

    <? XML version = "1.0" encoding = "UTF-8"? > <!-example XML file generated by XMLSpy v2008 rel. 2 sp2 (http://www.altova.com)-> < answer xsi: schemaLocation = "http://www.ept.lu/soa/2.0/Envelope Envelope_WSLF.xsd" xmlns = "http://www.ept.lu/soa/2.0/Envelope" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:pivot = "http://www.ept.lu/soa/2.0/Pivot" > < header > < senddt > 2010-12-17 T 09: 30:47.0Z < / senddt > < correlationid > 22222222 < / correlationid > < service > < type > WS - ATH < / type > < action > WS-ATH_ActivationSuccess < /. action > < / service > < source > < name > IOP < / name > < id > YYYYYYY < /ID > < / source > < destination > < name > OAO < / name > < id > XXXXXXX < /ID > < / destination > < authentication > < userid > USERID_OAO < / userid > < password > PASSWORD_OAO < / password > < / authentication > < / header > < body > < pivot : customer > < pivot: services > < pivot: service > < pivot: accessServiceId > 13100000000 < / pivot: accessServiceId > < pivot: serviceAttributes > < pivot: attribute > < pivot: name > BOOKING_MANAGER_ID < / pivot: name > < pivot: value > 12521515 < / pivot: value > < / pivot: attribute > < / pivot: serviceAttributes > < pivot: serviceAttributes > < pivot : attribute > < name: PivotTable > DEER < / pivot: name > < pivot: value > 1286001434 < / pivot: value > < / pivot: attribute > < / pivot: serviceAttributes > < / pivot: service > < / pivot: services > < / pivot: customer > < / body > < fault > < code > MI.006 < / code > < reason > success: ATH < / pattern > < failure / > < / answer >

    I'm trying to extract some values based on labels, for example I need to retrieve the value contained in the group with the name "DEER" in a query, in this case waiting for the query to return 1286001434.
    I quickly tried this, which returns nothing (which is not surprised, I guess that's completely wrong):

    Select EXTRACTVALUE (m.xml_request,'/response/body/client/services/service/serviceAttributes/value[@name="STAG"]','xmlns= "http://www.ept.lu/soa/2.0/Envelope") 'DEER '.
    Message m

    Thank you for your help.
  • How to extract the values of XMLTYPE column,

    SQL > create table temporary global xmtype_tab (xmlfile xmltype);

    SQL > select * from all_directories;

    SYS RESTOREDIR/home / / dbimptask /.

    insert into xmtype_tab values (xmltype (dbms_xslprocessor.read2clob ('RESTOREDIR ','LAS_SETUP.xml ')));

    1 line of creation.

    SQL > select * from xmtype_tab;

    XMLFILE
    --------------------------------------------------------------------------------
    <? XML version = "1.0"? >
    rowset <>
    < ROW >
    < DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >


    How to extract the values inside each tag?


    XML file has the following data...


    rowset <>
    < ROW >
    < DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >
    < > 9600 BAUD_RATE < / BAUD_RATE >
    < ACK_TIMEOUT > 1 < / ACK_TIMEOUT >
    < TUBE_TRAVEL_LIMIT > 4 < / TUBE_TRAVEL_LIMIT >
    < SEND_SID_TIMEOUT > 1 < / SEND_SID_TIMEOUT >
    < INDEX_Q_TIMEOUT > 2 < / INDEX_Q_TIMEOUT >
    < HW_HANDSHAKING > 1 < / HW_HANDSHAKING >
    < / ROW >
    < / LINES > ';

    I use the Oracle 10.2.0.3 version...

    Why does this work?

    You are missing the tag of the ROWSET:

    select extractvalue (xmlfile, '/ROWSET/ROW/BAUD_RATE') baud_rate
      from xmltype_tab
     where existsnode (xmlfile, '/ROWSET/ROW/BAUD_RATE') = 1;
    
  • To extract the value of particular tag of xmlType

    Hello
    The requirement is to extract the value of the specific tab of an XmlType column.

    Here is the schema of the table:
    CREATE TABLE DTCC_REF)
    MESSAGE XMLTYPE NOT NULL,.
    CashFlowId varchar2 (20)
    )

    This table is already filled with only a value in the Message column. cashFlowId is null for all rows.

    Here are examples of MESSAGE data:
    <? XML version = "1.0" encoding = "UTF-8"? > < env:Envelope xmlns:rm = xmlns:pmnt 'OTC_RM_15-Apr-2005' = xmlns:env 'OTC_Payment_15-Apr-2005' = 'http://schemas.xmlsoap.org/soap/envelope/' xmlns:fpml = "http://www.fpml.org/2004/FpML-4-1" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "OTC_RM_15-Apr-2005... «/OTC/OTC_RM_15-Apr-2005.xsd OTC_Payment_15-Apr-2005... http://schemas.xmlsoap.org/soap/envelope/ /xmls/OTC/soap-envelope.xsd /OTC/OTC_Payment_15-Apr-2005.xsd "> < env:Header > < OTC_RM xmlns =" OTC_RM_15-Apr-2005 "> < manifest > < PaymentMsg > < activity > edit < / activity > < status > Matched < / status > < LinkStatus > Linked < / LinkStatus > < TransType > payment < / TransType > < AssetClass > credit < / AssetClass > < DTCCUserId > 00006151» < / DTCCUserId > < CounterpartyId > 00006132 < / CounterpartyId > < / PaymentMsg > < MsgId > 1 < / MsgId > < / Manifest > < / env:Header > < env:Body > < OTC_Payment xmlns = "OTC_Payment_15-Apr-2005" > < payment > < ReferenceIdentifiers > < TradeId > 1001513 M < / TradeId > < ContraTradeId > CREC5856 < / ContraTradeId > < LinkId > LINKEE1DSL890420 < / LinkId > < MatchId > PYMTEKGDRP784788 < / MatchId > < CashFlowId > 2005/12 / 200INTEUREUR1001513M < / CashFlowId > < 61326151EUR1220 NetId > < / NetId > < GroupRefId > < / GroupRefId > < ContraGroupRefId > < / ContraGroupRefId > < / ReferenceIdentifiers > < TradeDetails > < TradeType > EXOTIC < / TradeType > < TradeDate > 2004 - 09 - 13 < / TradeDate > < EffectiveDate > 2004 - 09 - 14 < / EffectiveDate > < ScheduledTerminationDate > 2014 - 09 - 20 < / ScheduledTerminationDate > < NotionalAmount > < fpml : currency > EUR < / fpml:currency > < fpml: Amount > 6000000.00 < / fpml:amount > < / NotionalAmount > < EffectiveRate > 0.3150000 < / EffectiveRate > < ReferenceEntity > < / ReferenceEntity > < / TradeDetails > < SettlementDetails > < SourceSSI > < / SourceSSI > < DestinationSSI > < / DestinationSSI > < / SettlementDetails > < / payment > < / OTC_Payment > < / env : Body > < / env:Envelope >

    Now, I have to fill out the tag CashFlowId value in column 2 of the table.

    How can I retrieve value da? Plase help me...
    SQL> with dtcc_ref as ( select xmltype('
    
      
        
          
            
              Modify
              Matched
              Linked
              Payment
              Credit
              00006151
              00006161
            
            2
          
          
            
              DTCC
              DTCC00006151
            
            
              
                http://db.com/route
                2005-11-26T13:59:29.593Z
                2005-11-26T13:59:29.593Z
              
              
                www.dtcc.net
                2005-11-26T09:47:00.000-05:00
                2005-11-26T09:47:00.000-05:00
              
            
          
        
      
      
        
          
            
              1006299M
              0900000702811
              LINKEBHBKD364294
              PYMTEKUBMKN02373
              2005/12/200INTUSDUSD1006299M
              61516161USD1220
              
              
            
            
              REC
              
                USD
                625625.00
              
              2005-12-20
              Unknown
              Fixed
            
            
              EXO
              2004-09-30
              2004-09-30
              2009-03-20
              
                USD
                247500000.00
              
              1.0000000
              
            
            
              
              
            
          
        
      
    ') xml from dual
    )
    --
    --
    select trim(x.column_value) CashFlowId
      from dtcc_ref t, xmltable('declare namespace e = "OTC_Payment_15-Apr-2005";
                                //e:OTC_Payment//e:CashFlowId/text()' passing t.xml) x
    
    CASHFLOWID
    ------------------------------------------------------
    2005/12/200INTUSDUSD1006299M
    1 row selected.
    
  • Req SQL syntax. to extract the value XML [CLOB]

    Hello

    I'll have the XML column in my table.

    I have XML value in CLOB data type. I had an experience using extract XML from SQL syntax.

    But I am unable to extract this file. I need to meet tagname value XML who gave example below.

    For example, the name of the Table is A
    Column name is A1

    The value of column given below here.

    <? XML version = "1.0" encoding = "ISO-8859-1? > < tags > < tag > < tagname > {docval} < / tagname > < tagvalue > ESPRefNotice < / tagvalue > < / tag > < tag > < tagname > {: inputvalue} < / tagname > < tagvalue > 3216 < / tagvalue > < / tag > < tag > < tagname > {officename} < / tagname > < tagvalue > ssvofficename < / tagvalue > < / tag > < / tags >

    Kindly help me on this to extract the value 'tagname' or 'tagvalue' according to the above xml data.

    Thank you
    SELECT warehouse_name warehouse,
       warehouse2."Water", warehouse2."Rail"
       FROM warehouses,
       XMLTABLE('/Warehouse'
          PASSING warehouses.warehouse_spec
          COLUMNS
             "Water" varchar2(6) PATH '/Warehouse/WaterAccess',
             "Rail" varchar2(6) PATH '/Warehouse/RailAccess')
          warehouse2;
    

    check this exp in the documentation
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions228.htm#CIHGGHFB

    the warehouse_spec is of type xmltype. So in your case it is clob then you need to add like what I did in the query...
    XmlType ()...

    Hope that explains everything...

    Ravi Kumar

  • Extract the value of the ring of text created by program

    Hello

    I have a spreadsheet I need to extract a single line. The first column of the worksheet has non-espacees values of time and feed these time values in a property node that is introduced in the Strings [] of a ringtone text indicator property node. The purpose of this is because I want the user to select only time for which the data were collected and, ideally, the zero point of time in the list corresponds to the zero line.

    However, when the user selects an element of the ring of text, the control passes the chain selected and not the associated value, despite the use of the "Value" property node You have any idea why this is happening? I know I could use the table 1 d of research VI to solve this problem, but I'm more interested in why it does not work. I have attached a few example data as well as the VI in question for reference. Thank you very much for your help!

    EDIT: It seems that this can explained by the fact the string, I am animals in the field [] of strings are numbers. When I did, I swapped the hours with random text strings, it works beautifully. Curious and curious...

    Jeff and Nathand,

    Thank you both for your responses. In fact, I was just able to solve the problem on mine in Exchange for the VI of subset of table with the Index of table VI. It works perfectly now, even with the values not assigned (even if it's an excellent suggestion, Jeff). Nathand, in which your question, select the indicator that I had attached to the control time no was not to display the value (0,1,2...) than I expected but the character string chosen itself, (-800,-750...) which confused me into thinking that something was wrong. I have attached the fixed VI for reference.

  • 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

  • XMLTABLE - how to extract the value of the escape of a node as-is sequence

    Hello

    How can I me XMLTABLE leave the string value of a node like the version with escape sequence, rather than unescaping it?

    E.g.:
    select extract(xmltype('<root><test>&lt;unset&gt;</test></root>'), '/root/test/text()').getstringval() col1 from dual
    union all
    select col1
    from   xmltable('/root' passing xmltype('<root><test>&lt;unset&gt;</test></root>')
                    columns
                    col1 varchar2(20) path 'test');
    
    COL1                                                                            
    ---------------------
    &lt;unset&gt;                                                                   
    <unset>     
    NB. you will need to hit rΘpondre α and then quote my post to see the actual text; For the life of me, I can't get the forum properly displays things. In short, the string returned by the EXTRACT is escaped, while the XMLTABLE chain is unescaped.


    ETA: I looked through the standards xml from the list of available functions, and nothing seems relevant. {noformat} * scratches head * {noformat}

    Published by: Boneist on March 19, 2013 14:11

    You can emulate what do I EXTRACT / getStringVal () by projecting the node text() as XMLType and type-casting to VARCHAR2 in the SELECT clause:

    SQL> set scan off
    SQL>
    SQL> select cast(col1 as varchar2(20))
      2  from xmltable(
      3         '/root'
      4         passing xmltype('<unset>')
      5           columns col1 xmltype path 'test/text()'
      6       ) ;
    
    CAST(COL1ASVARCHAR2(20))
    ------------------------
    <unset>
     
    
  • value chain control event does not trigger change

    Hello

    I am trying to scan a barcode with a barcode usb HID scanner. I use a structure of the event to detect the change in the value of a control of the chain. When I scan the barcode, the chain control updates on the front panel, but the event does not fire until I left on my mouse on the front panel. can someone help? See attached vi

    Your barcodes are probably fixed length. When you get an event, check the length. If it corresponds to the length of the barcode, then process the data, otherwise wait for more characters.  This can be treated very quickly in the case of the event.

    Lynn

Maybe you are looking for