String extraction

Hello

11 GR 2

I wrote the query to get the string of characters between ' # ' and ' $'.


Select

substr (
) ' ' $1084131 SALSLP, BK_ST, KYC_ID, # $1087408 SALSLP, BK_ST, KYC_ID, KYC_ADDRESS, # $1084132 SALSLP, BK_ST, ',.

InStr ('
' $1084131 SALSLP, BK_ST, KYC_ID, # $1087408 SALSLP, BK_ST, KYC_ID, KYC_ADDRESS, # $1084132 SALSLP, BK_ST, ',)
'$' ,
1 ,
1 ) + 1,
InStr ('
' $1084131 SALSLP, BK_ST, KYC_ID, # $1087408 SALSLP, BK_ST, KYC_ID, KYC_ADDRESS, # $1084132 SALSLP, BK_ST, ',)
'#' ,
1 ,
1 )-instr ('' $1084131 SALSLP, BK_ST, KYC_ID, # $1087408 SALSLP, BK_ST, KYC_ID, KYC_ADDRESS, # $1084132 SALSLP, BK_ST, ',)
'$') - 3
) RES

of double;

RES

SALSLP, BK_ST, KYC_ID

Please guide me to automate, so that it can get below result

RES

SALSLP, BK_ST, KYC_ID

SALSLP, BK_ST


Thank you

Or maybe you are looking for something more like:

SQL > ed
A written file afiedt.buf

1 with t as ("select $ ' 1084131 SALSLP, BK_ST, KYC_ID, SALSLP, BK_ST, KYC_ID, KYC_ADDRESS #1087408$, #1084132$ SALSLP, BK_ST ' double Str)
2  --
3 end of test data
4  --
5 Select regexp_substr (regexp_substr (str, ' [^ #] +', 1, level),'[^ $] +', 1, 1) ID
6, regexp_substr (regexp_substr (str, ' [^ #] +', 1, level),'[^ $] +', 1, 2) as vals
7 t
8 * connect by level<= regexp_count(str,="">
SQL > /.
ID VALS
------------ --------------------------------------------------
1084131 SALSLP, BK_ST, KYC_ID,
1087408 SALSLP, BK_ST, KYC_ID, KYC_ADDRESS,
1084132 SALSLP, BK_ST

3 selected lines.

Of course, it is not good design to store multiple values in a single value data type, because it causes the problem of dividing the data.

I hope that you do not store this data on the actual database tables?

Source of data?  If it comes from a file, then it may be better to use an external Table (with perhaps some pre-treatment instructions) to read it better.

Tags: Database

Similar Questions

  • String extract hexadecimal number

    Normal 0 I have device that returns the response of multi line where I need to extract a hexadecimal number in this f01a.ad70.db84 patten

    The hex number will be chamge, but in same patten (FFFF. FFFF. FFFF)

    Thank you.

    I tried to delete all the "pass" with a 'space' to make a line. Then I just kept passing the remaining string in a registry to offset. Don't know if its more simple, just another way to do it.

  • String extract

    Hello
    I want to extract the charater string in a column that contains mixed data with special characters and character string.
    say from ' # @ $abc$ $% _ ' this string I want to extract 'abc '. Source is a csv file and there may be a number any special characters before and after the string.
    Can someone help me? the basic version is 10g...
    Thank you!!

    Published by: user10911550 on September 30, 2009 12:29

    Maybe this:

    SQL>  select str, regexp_substr (str, '\w+')
    from (select '##@@$abc$$%_' str from dual)
    /
    STR          REGEXP_SUBSTR(STR,'\W+')
    ------------ ------------------------
    ##@@$abc$$%_ abc
    1 row selected.
    
  • digital data of string extraction

    Hi all

    How can I extract a digital part of a Varchar2 column...

    the data are

    success 111,98
    gsdhgadg 52365.878 hdfjhfd
    ttqweqwg3321.7676jdshfjhsf

    all channels above I want to extract 111,98, 52365.878, 3321.7676

    How can I most effectively... is theer any inplace analytical to achieve this function?

    Help, please...

    With regular expressions like this

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'transaction 111.98 sucess' as txt from dual
      2       union select 'gsdhgadg 52365.878 hdfjhfd' from dual
      3       union select 'ttqweqwg3321.7676jdshfjhsf' from dual)
      4  -- end of test data
      5  select regexp_substr(txt, '[0-9.]+') as num
      6* from t
    SQL> /
    
    NUM
    --------------------------
    52365.878
    111.98
    3321.7676
    
    SQL>
    
  • How to assign to the variable of type XML with function extract values?

    Hello

    I have variable XMLTYPE LeXml have under folder

    <? XML version = "1.0" encoding = "utf-8"? >
    < soap envelope: xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" >
    < soap: Body >
    < AddListing xmlns = "http://www.christielites.com/" >
    string of < sComCode > < / sComCode >
    string of < sLocCode > < / sLocCode >
    dateTime < dStart > < / dStart >
    dateTime < made > < / made >
    < sEcode > string < / sEcode >
    < iAvail > int < / iAvail >
    < iOwned > int < / iOwned >
    string of < sPostTrans > < / sPostTrans >
    < / AddListing >
    < / soap: Body >
    < / envelope soap: >

    I want to get the sEcode value chain in a varialbe using the extract function or another?

    can someone give me the syntax FRO it?

    I tried with Mstring:=LeXml.extract('AddListing/scomcode/text()').getStringval(); but iam in error
    ERROR on line 1:
    ORA-31011: XML parsing failed
    ORA-19202: an error has occurred in the processing of XML
    LPX-00601: token not valid in: "soap:Envelope/text().
    ORA-06512: at "SYS." XMLTYPE", line 111
    ORA-06512: at the 'BLUEWATER '. CREATELERESPONSELOG', line 12
    ORA-06512: at line 1

    Please guide me.
    Mstring:=LeXml.extract('AddListing/scomcode/text()').getStringval(); 
    

    should be

    Mstring:=LeXml.extract('/soap:Envelope/soap:Body/AddListing/sComCode/text()', 'xmlns="http://www.christielites.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"').getStringval(); 
    

    I used to request verification is

    select xmltype('
    
    
    
    string
    string
    dateTime
    dateTime
    string
    int
    int
    string
    
    
    ').extract('/soap:Envelope/soap:Body/AddListing/sComCode/text()', 'xmlns="http://www.christielites.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"') from dual
    

    Ravi Kumar

  • ring, value of the attribute

    I want to replace the strings of the label of the ring (value/label pairs) after starting the program with the strings extracted from the Excel worksheet or a text file. I know how to implement this part but I do not know how to set the label with the command of the attribute. I found the command to set the label of the ring, but I want to change the label value/label pairs so that the user can change them according to the names of devices:

    Value label

    1 Device1

    2 Device2

    3 Device3

    Thank you for your help.

    Leszek

    Hello

    Take a look at InsertListItem (), ReplaceListItem () and DeleteListItem ().

    Good luck

    Wolfgang

  • XS: DateTime valid don't cast to TIMESTAMP

    Select xmlcast (xmltype ("< EndTime > 2015-06-09T 24: 00:00Z < /EndTime > '") AS TIMESTAMP WITH TIME ZONE) problemtime

    Double;

    Translated by ORA-01850: time must be between 0 and 23

    On the database Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    According to XML Schema Part 2: Datatypes Second edition

    24:00:00 is a valid time, and I'm not able to get the XML stream I'm the modified treatment.

    Two questions.

    Is this a known issue?

    Is there a round more enjoyable work that catch the error ORA-01850, checking the time is exactly 24:00:00 and he edit at 23:59:59?

    And like to work around this problem, I think there is no other way than a string extraction and he postprocess.

    For example:

    select case when substr(ts, 12, 2) = '24'
                then to_timestamp_tz(substr(ts, 1, 11)||'00'||substr(ts,14), 'YYYY-MM-DD"T"HH24:MI:SSTZR') + interval '1' day
                else to_timestamp_tz(ts, 'YYYY-MM-DD"T"HH24:MI:SSTZR')
          end as corrected_ts
    from (
      select xmlcast(xmltype('2015-06-09T24:00:00Z') as varchar2(30)) as ts
      from dual
    );
    
  • Extract the substring of the string

    For the life of me I can not find a function to extract a substring of an existing string.  The closest I could find was SearchSplit String and replace substring, but none of them do what I want.

    That's what I want to do:

    Assuming that the string "Test String", the letters are in positions as follows:

    T e s t _ S t r i e n t
    0 1 2 3 4 5 6 7 8 9 10

    Now correct the substring offset 5 on position 7 (length 3):

    Substring = r t S

    5 6 7

    In Java, for example, you can easily do this using the code below:

    String str = "Test String";

    Substring of String = str.substring (5.7);

    There are no simple function to do this in LabVIEW?  If not, what is the best way to do it?

    Use String subset of index 5 and length 3.

  • Analyzes the string and extract the string delimiter

    Hello

    Basic questions.  Is this possible with the scan of regular expression of the string to extract the string that are in the specified delimiters.  Here is an example:

    Name of the \\Name of the folder 1\Name to the folder 2\Name to the folder 3\File

    Chain analysis can produce the following by specifying the regular expression on the right:

    1 folder name

    Name of the folder 2

    Name of the folder 3

    File name

    I tried \\\%s\\%s\\%s\\%s but the %s stops on the first white space.

    Thank you

    Michel

    RavensFan suggested the service appropriate for your condition, but you can also use an alternative, which is "spreadsheet of array of strings.

  • Extract strings in the tdms files and write the strings in the file txt or lvm

    Hi all

    I'm struggling to extract strings from a file of tdms to write them in a txt file.

    The strings were written in tdms is a time stamp data recorded to a compact RIO.

    I put the chain in a different group from the PDM, but when I use the function read tdms with the group name, as I said, an error message is always take place.

    Thanks for all the help.

    PS: I have attached an example of tdms file I got over here.

    Kind regards

    Yifeng

    I tried your attached file and it seems that everything goes file. I have attached the screenshot of my VI here, what do you want?

  • How to extract the time to a string with lots of information?

    Well guys,.

    I have a question here...

    I need to extract only the TIME to a string. But that chain has a lot of information

    as a 'Identification' text data and time...

    This "Identification" may be only letters or numbers or words of 2 or 3...

    Anyone know a good way to do that?

    I tried:

    But only works if 'Identification' is only 1 Word...

    I'm using LabVIEW 7.1

    and the format is: ID - 14/04/2010 - 13:32:25

    Thank you

    Regular expression matching is available in 7.1?

    Match pattern works, too.

  • extracting columns of string array 2D according to the first item of each column

    Hello

    I have an array of strings 2D and I want to extract the columns according to the string value to items in each column to formulate a new 2D array. for example:

    in the joint excel table sheet a 2D. I need to extract all contain columns "CA/S -" string and "MS/s" to formulat + another array of strings 2D form columns that contain only 2 string values.

    Thank you very much and I would reaally any input apperciiate

    See you soon,.

    Mostafa

    Something like that?  I had to convert your Excel file into a CSV file.

  • Regular expression help please. (extraction of a subset of the string between two markers)

    I haven't used regular expressions before, and I can't find a regular expression to extract a subset of the string between two markers.

    The chain;

    Stuff of header I want
    Stuff of header I want
    Stuff of header I want

    Stuff of header I want
    Stuff of header I want
    Stuff of header I want

    6 ERRORS
                         
    Info I want to line 1
    Info I want line 2
    Info I want line 3
    Info I want to line 4
    Info I want to line 5
    Info I want line 6
    END_ERRORS

    From the string above (it is read from a text file), I try to extract the subset of string between ERRORS 6 and END_ERRORS. The number of errors (6 in this case) can be any number from 1 to 32, and the number of lines I want to extract will correspond with this number. I can provide this number of a caller VI if necessary.

    My current solution, which works, but is not very elegant;

    (1) using Match Regular Expression for the return of the string after you have synchronized the 6 ERRORS

    (2) uses the Regular Expression matches to return all characters before game END_ERRORS of the string returned by (1)

    Is there a way this can be accomplished using 1 Regular Expression Match? If so someone could suggest how, as well as an explanation of the work of the given regular expression.

    Thank you very much

    Alan

    I used a character class to catch any word or whitespace characters.  This put inside parentheses a substring matching the criteria that you can get by developing the node for regular expression matching.  The \d matches the numbers and the two * s repetition of the previous term.  So, \d* will find the '6', as well as "123456".

  • How to extract string in JSON data where the value in a table

    Hello

    Structure of JSON string

    {'name': 'John', 'name': 'kumar', 'address': [{'Address1': 'value', 'place': 'value'}, {'address2': 'value', 'place': 'value'}]}

     


    How to extract the value of the address of the list.

    If you have control over the format of data, it is best to rename address1 and address2 to have the same name, for example "address". Then, it can be analyzed that way (I've also simplified other code a bit):

    JsonDataAccess jda;
    QVariant v = jda.loadFromBuffer(jsonString);
    QVariantMap m = v.toMap();
    QString name = m["name"].toString();
    QString surname = m["surname"].toString();
    QVariantList addresses = m["address"].toList();
    foreach (QVariant addr, addresses)
    {  QVariantMap addrMap = addr.toMap();
      QString addressValue = addrMap["address"].toString();
      QString place = addrMap["place"].toString();
    }
    
  • How to extract the corresponding regex string

    Hello

    I am trying to extract text from a long string using QRegEx. Here's my regex:

    Rx QRegExp ("^. *(192|210). * key =? *");

    QString url = ""https://192.168.1.10/files/30/encrypt/key=s6h779bf " "

    rx.setPatternSyntax (QRegExp::Wildcard);

    rx.indexIn (str, 0);

    qDebug()<>

    qDebug()<>

    However, it is does not match anything.

    If I change the regular expression of "(192|210)." * key =? ' * ' can he match but I can't get the string after the = key

    You use a regular expression capture if you want that the parameter "key."

    QRegExp rx("^.*(192|210).*key=(.*)?");
    
    qDebug() << rx.cap(1);  // here's the first octet of your IP
    qDebug() << rx.cap(2);  // key parameter (optional)
    

    Your regex could do with a lot of improvement in my humble opinion. You might want to consuder the class QUrl that does what you want already:

    QUrl url("https://192.168.1.10/files/30/encrypt/key=s6h779bf");
    
    qDebug() << url.queryItemValue("key");
    

    Tip: rubular is a handy Tester on the regex web which makes this kind of thing much easier to debug

    http://rubular.com/

Maybe you are looking for