InStr to get part of a string

Hello

I have a 2 channels as below. I try to get the 3rd part of the string. I wrote the substring with instr, which ends by 4. He works for the 1st string. But, as the third segment of the second string

0110.5210101490.0102.586130.000.14000.240000.A.000000000.000000 - result 0102

0110.5210101490.0005605.586130.000.14000.240000.A.000000000.000000 - results 0005605

Any suggestions...

with dataset as)

Select '0110.5210101490.0102.586130.000.14000.240000.A.000000000.000000' double str

Union of all the

Select "0110.5210101490.0005605.586130.000.14000.240000.A.000000000.000000" from double

)

Select str, substr (str, instr (str,'.)) ((', 1, 2) + 1, instr(str,'.',1,3)-instr(str,'.',1,2)-1)

of the dataset

Tags: Database

Similar Questions

  • Calculation for cutting the first part of the string in the Manager list item values

    Hello

    Please help me with a calculation after submit pl/sql function process for cutting the first part of the string (CQ.) within the values of list manager. For example the list manager support contains values such as

    CQ... SAMPLE1... TEST1

    CQ... SAMPLE2... TEST2

    CQ... SAMPLE1... TEST2

    The calculation process should cut the first part(CQ..) and must return to the list of values of Manager as

    SAMPLE1... TEST1

    SAMPLE2... TEST2

    SAMPLE1... TEST2

    Oracle APEX 4.0.2 is the version and Oracle 10 g r2 is the database.

    Please help me with possible approaches in the development of the service. Thanks in advance.

    Thank you

    Orton

    orton607 wrote:

    But when I insert/update Manager list item values I don't want the first part of the string in the database.

    I still don't understand why you can't change the LOV or create a new...

    The LOV should be:

    SELECT original_value  AS HUMAN_SEES_THIS_VALUE
        ,LTRIM (SUBSTR ( original_value, INSTR (original_value, '..') + 2))
          AS DATABASE_GETS_THIS_VALUE
    FROM (
      -- place original SQL for LOV here
    )
    
  • Reading the part of a string

    I have a table with a column "otname."
    Table1.otname contains several lines of alphanumeric string that resembles the following sample data:

    11.10.32 * 12 *. U.A.F.3.2.21.249.1
    2001.1.1003 * 8281 *. A.THE. PAINVIN
    2010.1.1003 * 8261 *. A.THE. B.B

    I want to read the fourth number in each chain (part of the string in bold) and write a query in Oracle 10 g
    to read its description stored in another table. My dilemma is to write the first part of the query.i.e. Choose the fourth issue of each string in an array

    My second query will be something like this:
    select description_text from table2 where sncode = 8281  -- fourth part of the data sample in every string
    Thank you very much.

    novice

    Oops... I forgot to change that:
    Fixed query:

    SELECT   description_text
       FROM   table1, table2
      WHERE   SUBSTR (otname, INSTR (otname,'.', 1, 3)
                             + 1,
                             INSTR (otname, '.', 1, 4)
                                  - INSTR (otname,'.', 1, 3)
                                  - 1)
                                   = sncode
    

    This will return rows from your table if the sncode appears as the fourth string (delimited by '.') in otname. What is your requirement?

    Kind regards
    JO

  • When executing "Difficulty It Center Microsoft" I get a message "input string was not in a correct format." What does that mean?

    When executing "Difficulty It Center Microsoft" I get a message "input string was not in a correct format." What does that mean?

    Hello

    The question you have posted is related to Microsoft fix and would be better suited in the Microsoft Support Tools Forums. Please visit the link below to find a community that will provide the support you want. http://social.Microsoft.com/forums/en-HK/fixitcenter/threads

  • Items purchased and it appears I have got only the part of editing photos and movies. How can I get part 2 of my order?

    Items purchased and it appears I have got only the part of editing photos and movies. How can I get part 2 of my order?

    Please post related queries from Photoshop Elements

    http://forums.Adobe.com/community/photoshop_elements

  • VM models automatically get a length of string VM value!

    Hi guys,.

    I use lab Manager 3.0 (3.0.2.56), and I created a few models gold.

    I'm deployment new configurations in my workspace using Option of linked Clone and clone not fully, always my Gold models VM automatically get a length of string VM value!

    No idea why this is happening? I'm worried because I need to consolidate all these models to take back the length of the string VM to 0

    (Ideally models don't get any length of string VM right?)

    Kind regards

    esxvmuser

    The mode of operation is a little more complicated than that. Let's say you start with a template and it has a string length of 0 and is located in the 100 on the data store directory.

    The first time that you deploy a virtual machine using this model configuration, the model will be immediately Branch once in machine 101.

    101 machine is the configuration of the virtual machine that you have created and are a 100 machine delta drive. It has a length of chain 1. The string for this virtual machine looks like 100-> 101. the length of the string of the model is always 0.

    Now let's say you do not publish your model you can make some changes to it. As soon as you do not publish the template, it will create branching in a new machine, machine to 102.

    Machine 102 now is the model and it is the length of string is 1. He now has a record of delta. The original model is still in the 100 directory, but it cannot be touched. If you deploy the model, you deploy machine 102 and 100 machine remains intact. Whatever changes you make to the model has no effect on the configuration of virtual machines that have been already deployed from it. The string for this virtual machine looks like 100-102 >.

    Hope that clarifies things.

  • Get filename of a string including filepath and filename

    How can I get a file name from a string that includes the filepath and filename? The path is not always the same. For example, the variable may include a "C:\temp\test.doc" or "C:\files\docfiles\test.doc" and I need to get the file name "test.doc" and save it in another variable. Thanks in advance.

    on vPath getFilenameFromPath
    oldDelim = the itemDelimiter
    itemDelimiter = the last char of the moviePath

    iFilename = the last element of vPath

    itemDelimiter = oldDelim

    return iFilename
    end

    Put that in a movie script. Then, you can call the function from anywhere, anytime
    to retrieve the last part of the path - like this:

    set getFilenameFromPath("C:\temp\test.doc")
    -"test.doc".

    As a bonus, it is cross-platform, so it does not work on a Mac as well
    as a PC.

  • CWIMAQdx.GetAttribute failed to get attributes in the string or format U32.

    I'm reading all the attributes of a Gige camera. I can get the I64, F64 attributes and Boolean marker. But when the type is string or U32, the returned object "attribute" is "NULL". Can someone let me know what is wrong with my code?

    Thank you

    object attribute = new object();

    if(stype=="I64")

    {

    CWIMAQdx.GetAttribute (sid, attributeInformationArray [i]. Name, CWIMAQdx.ValueType.I64, out attribute);

    sValue = Convert.ToInt64 (attribute). ToString();

    }

    If (sType is "String")

    {

    CWIMAQdx.GetAttribute (sid, "attributeInformationArray [i]. Name', CWIMAQdx.ValueType.String, out attribute);

    sValue = Convert.ToString (attribute);

    }

    If (sType is "U32")

    {

    CWIMAQdx.GetAttribute (sid, "attributeInformationArray [i]. Name', CWIMAQdx.ValueType.U32, out attribute);

    sValue = Convert.ToUInt32 (attribute). ToString();

    }

    Is it just a coincidence that in your second two cases (you mentioned do not work) your code example seems to be passing the constant "attributeInformationArray [i]. Name"rather than the actual attribute name?

    Eric

  • where can I get parts for my xbox 360 arcade

    I have the original arcade xbox 360 (contains no internal hard drive) I need spare parts. motors, fans, heat sinks, etc that I can't seem to be able to find a Red rings box that I can use for cooling parts. can someone give me a hand. some info on how to get a f box * cheap or free would be cool but any info would be nice. Thank you

    PS: anyone know what microsoft did with the boxes Red rings that are sent their?

    Hello

    The Microsoft Community (formerly answers) has no influence on the XBox or XBox Live
    If you need to contact them.

    XBox - Support
    http://support.Xbox.com/en-us/pages/default.aspx

    XBox - Contact us (support)
    http://support.Xbox.com/en-us/contact-us

    XBox - Support Forums - and my XBox (top-right)
    http://forums.Xbox.com/

    Xbox technical support phone number

    • Toll-free: (800) 4MY-XBOX or (800) 469-9269

    Opening hours: 600 PM 2200 h / Pacific / daily

    International (direct line in the U.S.): 425-635-7180

    XBox LIVE - Service status
    http://support.Xbox.com/en-us/Xbox-Live-status

    Manage the XBox Live account
    http://support.Xbox.com/en-us/billing-and-subscriptions/account-management/Xbox-Live-account-management

    XBox Live Sign-in problems
    http://support.Xbox.com/en-us/billing-and-subscriptions/Windows-Live-ID/Xbox-Live-sign-in

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • where can I get parts to repair laptop HP Pavilion dv9233cl

    I need a few cialis for my

    HP Pavilion dv9233cl notebook PC... Where can I get them?

    Here is the part number you need:

    Power connector (includes together power connector
    cable and power connector mounting bracket) 432985-001

    That's all for $7.29, including shipping.

    http://www.eBay.com/ITM/for-new-HP-DV9000-DV9500-dv9700-AC-DC-power-Jack-Board-432985-001-CX66394V-0-/270905475225?PT=Laptop_Adapters_Chargers&hash=item3f13398099

    Here is the service manual showing how to install it:

    http://h10032.www1.HP.com/CTG/manual/c01311536.PDF

    See Page 5-71

    If it's 'the Answer' please click on 'Accept as Solution' to help others find it.

  • find if get date and time string function is used in my labview vi

    Hi, I am trying to understand a labview project and wanted to determine if the DATE STRING function / hour GET is used in VI. This VI has many void too / vi... I know that we can find all instances of all indicator etc... but I can also do something like this to find all the functions of DATE STRING / hour GET used?

    Hi Claudia AG

    Open the block diagram of the main vi, press 'Ctrl + F' and select 'object '. See image below

  • get the response XML string

    Hello friends, I get an XML response like below. Now, I want to get is the string ' hello world '. How can I retrieve the XML response? I have to change something in the side Server? Y at - it a tutorial for sending xml soap request?

    
    
    
    http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    
    
    
    http://www.XYZ.com/abc">
    
    Hello World from XYZ
    
    
    
    
    
    
    

    Are you absolutely sure that tempStream contains your XML file? It seems that XML is not reached the parser.

  • How to use Substr and Instr to get data from a file

    Hi I have a script

    I get a file like this

    1.20, ram, sales

    I get a file as these data as a column

    I want to divide these data into 4 different columns as

    1 20 sales of ram

    Hello

    This query will help you.

    Select

    SUBSTR (C1, 0, INSTR(C1,',')-1).

    SUBSTR (C1, INSTR (C1, ',') + 1, INSTR(C1,',',1,2)-INSTR(C1,',',1,1)-1),

    SUBSTR (C1, INSTR(C1,',',1,2) + 1, INSTR(C1,',',1,3)-INSTR(C1,',',1,2)-1).

    SUBSTR (C1, INSTR(C1,',',1,3) + 1, INSTR(C1,',',1,4)-INSTR(C1,',',1,3)-1)

    SUBSTR (C1, INSTR(C1,',',1,3) + 1)

    BeO

    Select 1, 20, ram, C1 double sales

    )

    Remember that a comma is not really safe as field separator

    Post edited by: DecaXD

  • REGEXP_REPLACE &gt; need to isolate only part of a string

    Hello world

    I hope someone can help me with this REGEXP_REPLACE building that I am on it for about 5 hours and I think I'm going crazy. :)

    So, I have a field in my DB that is populated by many lines like this:

    BREAKFAST 15: 00
    DINNER 30.00
    CITY TAX 1,50
    SPA 150.00


    It is an example.
    The field can be filled with this information, with lines, fewer lines, can be empty.

    What I have to do is to isolate only the price of the TOURIST tax. In this example, I need to get only the string "1.50'.» If the field is empty or if I don't have a line with tax, I need to go back to 0.

    My test is as follows:
    I made only one line and removed the spaces like this:

    Replace (replace (: RATE_PACKAGES, ' ', "), Chr (10),")

    Being the field of my DB RATE_PACKAGES that contain the information I need.

    With this replaces 2 I have: BREAKFAST15.00DINNER30.00CITYTAX1.50SPA150.00
    It's a bit ugly, but it seemed to me the best way to do it for me. :(

    And after that I did a single line without spaces, here's my REGEXP_REPLACE:

    regexp_replace (replace (replace (: RATE_PACKAGES, ' ', "), Chr (10),"), ' ([[: graph:]] *)([CITYTAX]) ([[: graph:]] {4})([[:graph:]]*)', '\3')

    I used [[: graph:]] * to exclude all printable characters from the string before tax then [[: graph:]] {4} to isolate the 4 characters (1.50) following the TOURIST tax and finally [[: graph:]] * yet to exclude all printable characters in the string that follows the price of the TOURIST tax.
    I'll be back only what I need with \3.

    This works perfectly if the TAX is the last line in the field = > ' 1.50'.»
    If there is something after, as in the example above, it returns = > 'PA15.

    I don't understand why. And there may be a simple way to proceed?

    I have tried several combinations in the REGEXP_REPLACE but I never get to get what I want. :(

    Edited by: 982238 Jan 16. 2013 16:17

    Hello

    Are you sure that it is not working?

    WITH mydata(rate_packages) AS
    (
    SELECT 'BREAKFAST 15.00
    DINNER 30.00
    Taxe de Séjour 1.50
    SPA 150.00'FROM DUAL UNION ALL
    SELECT 'BREAKFAST 10.00
    DINNER 40.00
    SPA 190.00'FROM DUAL UNION ALL
    SELECT '' FROM DUAL
    )
    SELECT NVL(LTRIM(REGEXP_SUBSTR(rate_packages,'Taxe de Séjour +([0-9.]+)',1,1,NULL),'Taxe de Séjour '),0) City_tax_rate
    FROM mydata;
    
    CITY_TAX_RATE
    -----------------------------------------------------------
    1.50
    0
    0            
    

    Kind regards.
    Al

  • You are looking for a final part to a String

    I have problem in searching for names.
    I have the table from the list of contacts. in the table and the following data
    create table contact_list(id number(9), name varchar2(20), address varchar2(200), tel varchar2(20));
    insert into  contact_list values(1,'Dell corp.','shah ','686910');
    insert into  contact_list values(2,'GAC Egypt Ltd.','shah ','686910');
    insert into  contact_list values(3,'Muammar Ali Ahmed corp.','shah ','686910');
    insert into  contact_list values(4,'Fasail Mohmed.','shah ','686910');
    insert into  contact_list values(5,'MS London Ins.','shah ','686910');
    insert into  contact_list values(6,'Cairo university.','shah ','686910');
    insert into  contact_list values(7,'Daniel John company','shah ','686910');
    So, the problem when the user search for any contact name some time the name is the typo or spelling is not correct.
    to resolve this issue by using the SOUNDEX function... I tried to function SUB_STR to compare just the last part.
    select name from contact_list where  soundex(upper(trim(substr(name, instr(name,'' '',-1,1),length(name)))))=upper('LONDON');
    but this query compares the last part of the statement with "LONDON". Thus, the results have nothing because online no5 will compare Assur with "LONDON".


    what I need to compare the last part on instruction with ignoring the last part if there contains ".COM company or university or factory org or origination.

    or if you have another idea, let me know that.

    concerning

    Maybe as no version specified NO TESTS!

    select distinct name
      from (select name,
                   substr(name,
                          instr(' ' || name,' ',1,level),
                          instr(name || ' ',' ',1,level) - instr(' ' || name,' ',1,level)
                         ) sub_string
              from contact_list
              connect by level <= length(name) - length(replace(name,' ')) + 1
                     and prior name = name
                     and prior dbms_random.value is not null
           )
     where soundex(sub_string) = soundex('LONDON')
    

    Concerning

    Etbin

Maybe you are looking for

  • Audio video?

    I shot a video on my iPad and I would like to add an audio track.  The video begins in the Photos, but I don't see a way to add a video track to it?  Is there a way to do it or do I need third party software? Thank you

  • Installation of Windows XP on a Satellite L40-14B

    I bought a toshiba Satellite L40 - 14B with nothing on it, and I can not install xp on it because the hard drive is sata.Can someone help me pls? I don't have a usb floppy drive. Where can I find the driver for the hard drive and how do I add it for

  • access to the controls of an another VI property

    Hello I have A.i and B.vi. B.VI has Integer1 control. Replace Integer1 value (Value property) A.i I can use "control valueand" method. Maybe it's to change the other properties (for example, disable) Integer1 of A.i control? Thanks, Andrey.

  • Have a Windows update and my screens are all screwed up now, Please HELP!

    I am running Vista Home Basic and day before yesterday when I rebooted my computer, a Windows update itself installed. He said he was installing 1 of 1 files. I knew the idea of what the update was for, but when I brought my system to the top of the

  • Uninstall and reinstall vista and drivers etx

    Impossible to uninstall and reinstall vista