Splitting Contents of a Column

I need to break (split) the content of a column into four individual elements. The content on this column is made up of four (4) parts, each part is separated by an underscore character (_). Each part contains a variable value, so the underscore character is not fixed.
Column format: Part1_part2_part3_part4
Example;
aaaa_bbbb_cccc_eeee
aaaaa_bbbb_ccccc_eeee
aaa_bbb_ccccc_eeeee
aa_bbbbbb_ccc_ee
I would like to end up with each part separated from the original value. So, that I can group by the value for each part (Part1, part2, part3, or part4)
Wanted result (this is only represents the values for “Part1” from example)
Part1 values;
aaaa
aaaaa
aaa
aa
Thank you in advance

1) It sounds like you have a problem with incorrect normalization. Your column is not atomic. Your table should really have 4 separate columns to store each component. It's far easier to combine 4 columns to get a combined value than to try to parse a compound column.
2) That said, you can use the SUBSTR and INSTR functions to parse the data
SQL> ed
Wrote file afiedt.buf
  1  with x as (
  2    select 'aaaa_bbb_cc_eeeee' compound from dual
  3  )
  4  select substr( compound,
  5                 1,
  6                 instr( compound, '_', 1, 1 ) - 1 ) part_1,
  7         substr( compound,
  8                 instr( compound, '_', 1, 1 ) + 1,
  9                 instr( compound, '_', 1, 2 ) -
10                    instr( compound, '_', 1, 1) - 1) part_2,
11         substr( compound,
12                 instr( compound, '_', 1, 2 ) + 1,
13                 instr( compound, '_', 1, 3 ) -
14                    instr( compound, '_', 1, 2) - 1) part_3,
15         substr( compound,
16                 instr( compound, '_', 1, 3 ) + 1,
17                 length(compound) -
18                    instr( compound, '_', 1, 3) - 1) part_4
19*   from x
SQL> /
PART PAR PA PART
aaaa bbb cc eeeeJustin

Similar Messages

  • Why split content on a country by country basis?

    What I want to know is why Apple went down the road of splitting content on a country by country basis? I know that the good folks at Apple like to think that they "think different" but even they must be shaking their heads at the mess they have created. All they needed to do was look at a model that actually works: E-Bay. If I live in Canada -- which I do -- and want to sell whatever to my fellow Canadians, no problem. If I want to sell it across the border in virtually any other nation, all it takes is the clicking of a radio button. If I want to preclude a particular nation, it  likewise requires a click or two. Buyers are likewise empowered.
    Now take Apple. I've published an iBook Textbook [Yes I know: My first mistake.] I initially published it in Canada and a handful of other English speaking countries. Since it's an ESL textbook I've had enquiries now from Japan, Korea and Thailand, all looking to download the FREE sample and/or buy the book. But in Apple's world, they can't. And I can't upload it to the iTunes/iBookstore/iCouldNotGiveADamn in those countries either. This is not an option. This is an English language book that educators in those coutries have expressed an interest in. This isn't a technological problem related to fonts, l-to-r reading or anything of that nature. This is a problem related to bad decision making in the boardroom.
    Another example of a model that works? Amazon. Apple has the technological lead with iBA but Amazon will catch up. Then you want to see rats leaving a sinking ship? I'll be the first in the water. This bizzare, control-freak approch is going to sink Apple's aspirations to dominate the textbook market.

    You are just talking to other users like yourself in these forums, so be sure to repost to your comments to the channel where Apple will definitely see them
    http://www.apple.com/feedback

  • Upgrade SharePoint Content Types / Site Columns declaratively in SharePoint hosted apps

    Hi!
    I have a question where I was unable to find any official guidance for. I have created a SharePoint hosted APP where I have multiple site columns and content types (declared in XML). The APP installs and functions just fine. 
    Now I have a requirement to change a site column (Choice field, just add some more choice values). I was able to update the site column but the changes will not be reflected on the list column (I think because there no way to push the changes).
    So is there an "official" way of changing site columns?
    Any help is appreciated!
    Thx!

    msdn -
    How to: Update app web components in SharePoint 2013 :
    We do not support changing the data type of a list or content type field (column) after its initial deployment in any
    circumstance. In particular, do not change the data type of a field as part of an app update (not
    even programmatically). As an alternative, you can add a new field. If the app includes custom item create, edit,
    or view forms; be sure to make corresponding changes in these forms. For example, add UI for the new field and remove UI for the old one. (In a provider-hosted app, you can programmatically move data from the old field to the new one and then delete the old.
    How to: Update apps for SharePoint
    [custom.development]

  • Splitting field into two columns

    HI,
    I'm told it is possible to have a field be split up into multiple columns in the details section of a report rather than having it listed in a single column.  How can this be accomplished?  I've heard it has something to do with subreports.
    For instance, instead of this:
    Bob
    Jane
    Sally
    Barbara
    Jim
    Dave
    It could look like this (columns not lined up in this example, not sure how to do it on this forum):
    Bob          Jane
    Sally          Barbara
    Jim          Dave
    Thanks

    No need to use subreports
    In section expert for the deatils section check box - Format with multiple columns
    A new tab appear - Layout - Define width to set up number of columns required.
    Ian

  • Can't see content of Text Column cells in Resource Usage View

    I am having an issue adding a custom pre-defined & pre-populated text column field to resource usage view ( in a pooled resource situation) in microsoft project 2013. It doesn't see how the Text column has been renamed or the content of those column's
    cells. Is there a workaround for this? Thanks

    TechNew User1111,
    Go to the following website and take a look at FAQs 51 and 37. They will provide the answer. If you still have a question, post back.
    http://project.mvps.org/faqs.htm
    Hope this helps.
    John

  • How to swap the contents between the columns?

    Hi,
    I've two columns in each page, and I need to swap the contents in 1st column into 2nd column and vice versa. Pl. suggest me the way to achieve this requirement and confirm whether any option available in script?
    Thanks in advance.
    Praveen

    Hey!
    This swaps just data, not formatting.
    // this will swap first and third column
    swapColumns(1,3);
    var myTable = (function(){
        if(app.selection[0].parent.parent instanceof Table)
            return app.selection[0].parent.parent;
        else
            return app.selection[0].parent;
    function swapColumns(sourceCol, destCol){
        if(sourceCol == destCol)exit();
        var sourceColCont = myTable.columns[sourceCol-1].contents;
        var destColCont = myTable.columns[destCol-1].contents;
        myTable.columns[destCol-1].contents = sourceColCont;
        myTable.columns[sourceCol-1].contents = destColCont;
    Hope that helps.
    tomaxxi
    http://indisnip.wordpress.com/

  • How do i split content from the text file using tab and spaces...?

    Hi.. Just want to ask help to all the experts. Im new in java and i have this problem on how to split the contents of the text file. ill show you the contents in order to let you see what i mean.
    FileName: COL.txt
    AcctNo AcctName Primary Secondary Status Opendate
    121244 IPI Company Noel Jose Active 12/05/2007
    As you can see the content i want to split it per column.. Please help me

    Jose_Noel wrote:
    Hi prometheuzz,
    What do you mean by one thread...?You created two threads* with the same question in it. That way, people might end up giving you an answer that has already been posted in your other thread: thus wasting that person's time.
    Just don't create multiple threads with the same question please.
    * a thread is a post here at the forum

  • Assigning External content type field column value using Client Object Model

    I have a problem assinging External column value to ListItem object with client object model-based application I'm developing. To be precise, I am able to retrieve data related to external content type by reading external list created from this content type
    but I don't know how to properly use it to assign value to this field. By doing some research on my own I concluded that BDC ID column from external list is the way to go since it uniquely defines selected row from external list but that doesn't
    tell me much since I don't know what to do with it. Currently I ended up with partial solution - to assign plain string value of picker column but that makes this value visible only in "View Properties" option on Sharepoint and not in "Edit Properties"
    which pritty much makes sence since it isn't properly related to rest of the data in specific row. Does someone have a better solution for this?
    Igor S.

    I think I understand your problem.
    In my example I have an external data column "Beneficiary Name", using a Beneficiary external content type (accessing a table of beneficiaries in a SQL table).
    I want to set the "Beneficiary Name" property using the client object model. I know the name of the beneficiary but not the ID value.
    It is a fairly simple solution. You just need to identify the name of the property SharePoint assigns to the ID field, in my case it is called "Beneficiary_ID". Then set the two properties as follows:
    thisItem["Beneficiary_Name"] = "Charitable Trust";
    thisItem["Beneficiary_ID"] = -1;
    thisItem.Update();
    Setting the ID property to -1 causes the server to do an automatic lookup for the ID from the value assigned to the item.

  • Dividing Spry Tabbed Panels content area into columns?

    Hi there.
    I am building a website and I want to divide the content area of a Spry Tabbed Panel into 3 columns for text.
    How can I do this?
    I thought about making divs inside the Panel but it would be too messy.
    Please let me know if there is a simple way to do this.
    Thanks in advance.

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryTabbedPanels.js"></script>
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet">
    <style>
    * {box-sizing: border-box;}
    body {width: 960px; margin: auto;}
    .TabbedPanelsContentVisible {overflow: auto;}
    .col33 {width: 33.3333%; float: left; padding: 15px;}
    </style>
    </head>
    <body>
    <div id="TabbedPanels1" class="TabbedPanels">
      <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0">Tab 1</li>
        <li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
      </ul>
      <div class="TabbedPanelsContentGroup">
        <div class="TabbedPanelsContent">
            <div class="col33">
              <h3>Column 1</h3>
            <p>Content 1</p>
            <p>Dicta sunt explicabo. Nisi ut aliquid ex ea commodi consequatur? Neque porro quisquam est, aut odit aut fugit, ut aut reiciendis voluptatibus maiores alias. Iste natus error sit voluptatem dicta sunt explicabo. Sed quia consequuntur magni dolores eos itaque earum rerum hic tenetur a sapiente delectus, cum soluta nobis est eligendi optio. Omnis voluptas assumenda est, nemo enim ipsam voluptatem neque porro quisquam est.</p>
            <p>Eaque ipsa quae ab illo inventore veritatis totam rem aperiam, qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, aut odit aut fugit, ut enim ad minima veniam. Id est laborum et dolorum fuga. Atque corrupti quos dolores et quas molestias qui ratione voluptatem sequi nesciunt. Temporibus autem quibusdam saepe eveniet ut et voluptates repudiandae sint sed quia non numquam eius modi.</p>
          </div>
            <div class="col33">
              <h3>Column 2</h3>
            <p>Content 1</p>
            <p>It is the star to every wand'ring bark, which alters when it alteration finds, love alters not with his brief hours and weeks. Or bends with the remover to remove. That looks on tempests and is never shaken; admit impediments; love is not love let me not to the marriage of true minds.</p>
          </div>
            <div class="col33">
              <h3>Column 3</h3>
            <p>Content 1</p>
            <p>The three cs - customers, competition and change - have created a new world for business while those at the coal face don't have sufficient view of the overall goals. In order to build a shared view of what can be improved, building a dynamic relationship between the main players. Highly motivated participants contributing to a valued-added outcome.</p>
            <p>Whether the organization's core competences are fully in line, given market realities the components and priorities for the change program an important ingredient of business process reengineering. Taking full cognizance of organizational learning parameters and principles, organizations capable of double-loop learning, working through a top-down, bottom-up approach. In order to build a shared view of what can be improved, maximization of shareholder wealth through separation of ownership from management measure the process, not the people. Presentation of the process flow should culminate in idea generation, taking full cognizance of organizational learning parameters and principles, the components and priorities for the change program. An investment program where cash flows exactly match shareholders' preferred time patterns of consumption from binary cause and effect to complex patterns, working through a top-down, bottom-up approach.</p>
          </div>
        </div>
        <div class="TabbedPanelsContent">Content 2</div>
      </div>
    </div>
    <script>
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    </script>
    </body>
    </html>

  • How to copy the content in XMLtype column between databases

    Hi, there,
    Does anyone know how to copy the content in XMLtype clumn between databases? I tried insert as select via database link and it gives me the following message:
    SQL> insert into nrt_ot_request_temp (SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML )
    2 select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia;
    select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia
    ERROR at line 2:
    ORA-00942: table or view does not exist
    Thanks,
    Jessica

    Hi Jessica,
    in my eyes the second statement
    select ... xmlstring_column ... from table@remote_side;
    causes the error. Columns of type XMLString internally are stored as CLOBs in Oracle. Unfortunately there are restrictions on statements for CLOBs and remote locators.
    It seems you cannot say
    SELECT clob_column FROM table@remote_site;
    Remark: For me this is a showstopper for the datatype XMLString if you cannot run a simple statement like this one. It seems you can do an insert and an update but no select.
    On the other hand your first statement
    INSERT INTO table_local SELECT * FROM table@remote_site;
    should work following the documentation.
    See also
    http://docs.oracle.com/cd_a97630/appdev.920/a96591/adl04mng.htm#98328
    Best regards
    Indu Keilitz

  • In content query webpart columns are not displaying after clicking on edit webpart.

    Hi,
    I created a content query webpart. I added one custom item style in ItemStyle.xsl. This template having some date operations. Some date comparisons. The issue is, template containing some variables but after selecting my template it is not showing the variable
    names to enter the list column. What will be the issue? Below is the code..
    <xsl:template name="BirthdayList" match="Row[@Style='BirthdayList']" mode="itemstyle">
        <xsl:variable name="SafeImageUrl">
            <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
                <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="DisplayTitle">
            <xsl:call-template name="OuterTemplate.GetTitle">
                <xsl:with-param name="Title" select="@Title"/>
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>  
    <xsl:variable name="EmployeeDesignation">
            <xsl:value-of select="@EmployeeDesignation" />
        </xsl:variable>
        <xsl:variable name="Birthday">
            <xsl:value-of select="@Birthday" />
        </xsl:variable>
        <xsl:variable name="dateTimeBirthday" select="ddwrt:FormatDate(string($Birthday), 1033, 3)" />     
                    <xsl:variable name="dateOfBirthday"  select="substring-before(substring-after($dateTimeBirthday, ', '), ', ')"
    />
                    <xsl:variable name="monthOfBirthday" select="substring-before($dateOfBirthday, ' ')" />
                    <xsl:variable name="yearOfBirthday"   select="substring-after(substring-after($dateTimeBirthday, ', '), ',
    ')" />
                    <xsl:variable name="TodaysDateOfBirthday">
                        <xsl:value-of select="ddwrt:FormatDate(string(ddwrt:Today()), 1033,3)"/>
                    </xsl:variable>
                    <xsl:variable name="TodaysDateOfBirthdayyy"  select="substring-before(substring-after($TodaysDateOfBirthday, ',
    '), ', ')" />
                    <xsl:variable name="TodaysmonthOfBirthday" select="substring-before($TodaysDateOfBirthdayyy, ' ')" />
                    <xsl:variable name="TodaysyearOfBirthday"   select="substring-after(substring-after($TodaysDateOfBirthday,
    ', '), ', ')" />
                     <xsl:if test="($dateOfBirthday)=($TodaysDateOfBirthdayyy)">
                     <xsl:if test="($monthOfBirthday)=($TodaysmonthOfBirthday)">
         <div>
            <div>       
        </div> 
        </div> 
        <table width="100%"> 
        <tr width="100%">
                    <td width="80%">
                                    <table>
    <tr>
     <td><b><xsl:value-of select="$DisplayTitle"/></b></td>
                       </tr>
    <tr>
    <td>  <xsl:value-of select="$EmployeeDesignation"/>
    </td>
                       </tr>
                                    </table>
                    </td>
                    <td width="20%">
                                    <table>                                               
    <tr>                      
    <td valign="top">
       <img width="60" height="60" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" title="{@ImageUrlAltText}" />                                                  
     </td>       
                                    </tr>
                                    </table>
                    </td>
       </tr>
        </table>
    </xsl:if>
           </xsl:if> 
    </xsl:template>

    Hi,
    Based on your example above, which columns / variables are not appearing when editing the CQWP that you want to bind managed properties / list columns to?
    Eric Overfield - PixelMill -
    ericoverfield.com -
    @EricOverfield

  • Split string into new column

    Hi All,
    Hoping you are able to help.
    I have a table of approx 16 items that I need to split,
    EG:
    CUSTOMER ACCEPTANCE - HAS BEEN DECLINED - DO NOT APPLY TO ACCOUNT
    CUSTOMER ACCEPTANCE -  HAS BEEN ACCEPTED - APPLY TO ACCOUNT
    CUSTOMER ACCEPTANCE - PENDING DECLINE - ESCALATION REQUIRED - RAISED IN PORTAL
    ESCALATION - RAISED - PENDING
    ESCALATION - NOT RAISED - STILL TO BE PROCESSED
    I need to Keep the first two sections, eg CUSTOMER ACCEPTANCE - HAS BEEN DECLINED in one column, and split off the remaining, eg DO NOT APPLY TO ACCOUNT into a new TEMP table to insert as a column into an existing table.
    With little SQL experience, I am having difficulties as they are all of different lengths / criteria etc. Some have 3 hyphens whilst others have 4+
    Is anyone able to help point me in the right direction with this request? I will be greatly appreciated.
    Kind Regards,
    BTMMP

    If you're trying to do this all in a SQL query or stored procedure, then you'll probably get better results on the SQL Server forums. However, if you're working with a PowerShell or VBScript that's doing the work, you're in the right place.
    Here's one example of how you could do what you're describing.  By the way, what do you want to do with the string "CUSTOMER ACCEPTANCE - PENDING DECLINE - ESCALATION REQUIRED - RAISED IN PORTAL"?  Should that be split into "CUSTOMER ACCEPTANCE
    - PENDING DECLINE" and "ESCALATION REQUIRED - RAISED IN PORTAL", or "CUSTOMER ACCEPTANCE - PENDING DECLINE - ESCALATION REQUIRED" and "RAISED IN PORTAL"?
    (In other words, should the script only split off whatever's after the final hyphen, or should it grab the first two pieces of text and split off everything else?)
    Here's an example in PowerShell which assumes that you want to separate out all text after the final hyphen in a string.  It uses a regular expression, though you could accomplish the same thing with Split, Join and Trim operations, if you prefer.
    $string = 'CUSTOMER ACCEPTANCE - HAS BEEN ACCEPTED - APPLY TO ACCOUNT'
    if ($string -match '(.*?)\s*-\s*([^-]*)$')
    $split = $matches[1], $matches[2]
    else
    $split = $string, ''
    Write-Host "Original String: $string"
    Write-Host "First Text : $($split[0])"
    Write-Host "Second Text : $($split[1])"

  • Refreshing JTable contents (rows and columns) handling.

    Hi,
    I have a general question related to refreshing the contents of JTable and handling some application specific requirements.In our application we are planning to refresh the contents of JTable automatically after certain period of time by fetching data from database and update the JTable contents or user has clicked refresh button.
    But following scenarios we are planning to handle when refresh is called automatically or user has clicked refresh button.
    1) User is working with data of JTable. Like rows of JTable has checkBoxes and user selects them and doing operation like viewing the details of selected rows in new details dialog. So if refreshing is done then the selection will be lost if I update the whole data in JTable.
    a)Will it be possible to append the data at the end of JTable rows without disturbing the existing JTable contents.
    b) Is it feasible to compare the data of existing rows and newly fetched rows and update only the rows whose values are changed in database or update specifically updated columns. But this comparision for finding changed values will result in performance problems.So are there any other alternatives of doing this, ideas are most welcome.
    c) Simple way is to alert the user that data will be updated and everything will be refreshed will be the choice in worst case.
    I guess many may have encountered such problems and may have solved it depending on the product requirements.
    Ideas and suggestions are most welcome.
    Regards.

    Hi,
    Here are my views and my assumptions.
    Assumptions :
    1) Your JTable is populated with list of Objects.
    2) Your tables in database is having columns like created date, created time, updated date updated time
    3) Order by clause for all the time will remain same.
    If these assumptions are correct then I think you can achieve your goal.
    Here how it is.
    Your application session will maintain last db hit time and will maintain for every hit that applicate made to fetch data from db.
    When object is created on the server side once it fetch data from table it will compare the created date/time or update date/time with the session varibale that holds last visit date/time. Based on this flag need to be set to indicate if this item is added/updated/deleted since last visit.
    And when all these object is returned to your client, the table model will iterate through the list and based on object index in the list and and if object is changed will update only that perticular row.
    Hope this is what you want to achieve.
    Regards

  • Showing contents of a column based on a condition for another column.

    Hello,
    I am trying to create a report that lists all of the Opportunities within our database. I need a few details about this opportunity to appear. I need the account name that this opportunity belongs to, amongst other things- which I can do, however I also need to show the number of UNITS for this opportunity BUT I have a condition that needs to be met before I show the number of units.
    I only want to show the UNITS IF the PRODUCTTYPE that this opportunity belongs to is "GA". Then I also need another column with UNITS in it, but again I only want the UNITS to appear if the PRODUCTTYPE IS DA.
    Essentially I am trying to find out the number of units per product type and I need these to appear in separate columns. If the PRODUCTTYPE doesn't meet the condition, i.e. the PRODUCTTYPE is not GA then I would like the field to be blank.
    I know that I should write this formula in the "Edit Formula" of the UNITS field, but I do not know how to write this condition.
    I would very much appreciate some help as soon as possible.
    Kind Regards,

    Hi,
    You need to use a case statement, it looks like this:
    CASE
    WHEN opportunity.producttype = 'GA'
    THEN opportunity.units
    ELSE NULL
    END
    Ofcourse you need to use the correct column names.
    Regards, Tim

  • Content of BLOB column - Urgent

    Hi,
    I can not find a file that was uploaded using a Form Application in a BLOB column. Please could you tell me where do the file resides in the database after uploading?. If I query the table it does not appear.
    Thanks
    Mariela

    Why do you think 32k is a problem for an integer?
    SQL>declare x integer;
      2  begin
      3  x:= 9900000000000000000000000;
      4* end;
    SQL>/
    PL/SQL procedure successfully completed.
    SQL>

Maybe you are looking for

  • Can not open Captivate files in Dreamweaver

    All files are in one folder - code attached <p><a href="NAME.htm" target="_blank" class="paragraph" title="TITLE">LINK TEXT GOES HERE</a></p> When the Captivate file was published, I selected the "Export HTML" check box. I put both .swf files, the .c

  • Material document not updated in inspection lot QALS table

    HI The inspection lot created for 04 inspection type  during Goods Receipt. The material document is appearing in the inspection lot but found not updated in table entries.  i.e.., QALS -MBLNR When i checked other inspection lots it was found updated

  • Batching one format in a folder with multiple formats?

    I am wondering if it is possible to set a batch command that will only process tiff files that also have .fff's and .jpg's within the same folder. I have 2500 images in 125 subfolders with all three formats in each folder. I know I can batch all the

  • Install SAP PI - Error in step 39 - Install Sofware Units

    Hi, I am trying the sap xi... but in step 39 of the installation the following error occurs: begin ERROR 2009-07-21 04:12:09.500 FJS-00003  uncaught exception: nw.sdm.deploymentErrorWithLog: SDM deployment failed for at least one of the components to

  • Syncing ipad resulted in deleting almost all aps, movies and music !

    yesterday i wanted to sync my ipad (before upgrading my ipad to ios4) but my computer didn't recognize my ipad anymore. By means of online help i found that restarting the ipodservice (service running in the background on my XP computer) and a comput