Remove ' / ' with a value of feld to create two rows

I have a table with a structure like

CREATE TABLE TEST
(
MOLDCODE VARCHAR2 (20 BYTE) NOT NULL ACTIVATE.
PRODCODE VARCHAR2 (255 BYTE),
DIAMCONTAINER NUMBER (4.1).
SEGMENT NUMBER (2.0)
)

And it contains data such as

MOLDCODE PRODCODE DIAMCONTAINER SEGMENT

ADE16920-1 CJ02A/SD51A 96 10
ADE20206 CT25A 95 8
ADE16912-1 DG31A 57 10
ADE16913 AS30A/DE28A 96 10
ADE17845 CJ24A/SD36A 96 10


I want to create another table saw which will remove / of prodcode and he will separate the values and forms two rows with the same values for the other fields.
for example.

Source: -.
MOLDCODE PRODCODE DIAMCONTAINER SEGMENT

ADE16920-1 CJ02A/SD51A 96 10
ADE16913 AS30A/DE28A 96 10

Purpose: -.
MOLDCODE PRODCODE DIAMCONTAINER SEGMENT

ADE16920-1 96 10 CJ02A
ADE16920-1 96 10 SD51A
ADE16913 AS30A 96 10
ADE16913 DE28A 96 10

Is it possible?
Need help for the same thing.

Check this box:

    SELECT moldcode,
           REGEXP_SUBSTR (procode,
                          '[^/]+',
                          1,
                          LEVEL)
              procode,
           diamcontainer,
           segment
      FROM t
CONNECT BY     LEVEL <= REGEXP_COUNT (procode, '/') + 1
           AND moldcode = PRIOR moldcode
           AND PRIOR SYS_GUID () IS NOT NULL;

See you soon,.
Manik.

Tags: Database

Similar Questions

  • Remove data with null value

    Hello

    I'm using Oracle 11 g. I have a table with an id of 3, node, the value column. Combination of the column id and node, that must be taken account for deletion on the registers.

    Here, I need to delete lines with the NULL value in the value column. If for a combination of id and node with non-null values, then I need to delete rows with a null value for this combination.

    If the combination of id, node is not null value then this records should not delete.

    Below table, I need to remove the second row, for which is a value not zero VOICE CAL '10' is there, so I need to delete the row with null values. (VOICE, CAL, NULL)

    Network, FL, there is no value is non-null then I should NOT delete this line.

    This table is to have 100 s of this association, we can delete data in a single delete query?

    Or how I can delete rows with nulls for this combination.

    Tab1

    VALUE OF THE NŒUD ID

    VOICE CAL 10
    VOICE CAL NULL
    NETWORK NULL FL

    Thank you

    Hello

    oradba11 wrote:

    Hello

    I'm using Oracle 11 g. I have a table with an id of 3, node, the value column. Combination of the column id and node, that must be taken account for deletion on the registers.

    Here, I need to delete lines with the NULL value in the value column. If for a combination of id and node with non-null values, then I need to delete rows with a null value for this combination.

    If the combination of id, node is not null value then this records should not delete.

    Below table, I need to remove the second row, for which is a value not zero VOICE CAL '10' is there, so I need to delete the row with null values. (VOICE, CAL, NULL)

    Network, FL, there is no value is non-null then I should NOT delete this line.

    This table is to have 100 s of this association, we can delete data in a single delete query?

    Or how I can delete rows with nulls for this combination.

    Tab1

    VALUE OF THE NŒUD ID

    VOICE CAL 10
    VOICE CAL NULL
    NETWORK NULL FL

    Thank you

    You can do this in a single DELETE statement (it is not a request), using an EXISTS or IN the subquery.  For example:

    REMOVE table_x m

    WHERE the value IS NULL

    AND THERE ARE)

    SELECT 0

    FROM table_x s

    WHERE s.id = m.id

    AND s.node = m.node

    AND s.value IS NOT NULL

    )

    ;

    If you would care to post CREATE TABLE and INSERT instructions for the sample data, and then I could test it.

  • DAQmx create track (I-current-Basic) 8 channels with different values of Shunt resistance

    Hello

    I want to measure 8 current channels with different values of Shunt resistance.

    Problem: The channel create DAQmx (HAVE current Basic) specifies that a value of Shunt resistance.

    How can I set the value of Shunt resistance for each channel individually?

    Concerning

    Marcel

    Hi Marcel_C,

    Take a look to get attached.

    Best regards

    Mencef

  • How to remove empty entries in a table and replace them with the values of the instance?

    I have a table with values and spaces elements. I want to organize items such as table contains only values eliminating the empty spaces and re-organize the table with the values of cotimuous.  I use a bollean table to populate the items, so the bolleans to false fill the empty I don't want spaces. How can I program the above operation?

    Thank you

    Thank you for your solution, but I just found an easier way. INDEXING CONDITIONAL!. How I miss that. in any case, thanks...

  • Save with the removal of the value 0 in FDM

    Hi all
    I want FDM to load in HFM all records within a flat file and records with the value 0 too.
    I checked in the log folder and I found the file name.log file that indicates that some records were excluded because "the value 0 and zero suppress is enabled."
    How can I change this option?
    I can't find it in FDQM... Is this an option HFM?

    I thank in advance

    Giacomo

    Edited by: GiacomoD may 6, 2010 07:54

    You must put the NZP expression on the auxiliary of amount in the Import Format.

  • Remove the NULL values and update the value according to the logic

    Hello

    The problem data

    CREATE TABLE VOLA (SRNO, NUMBER, zeroNUMBER, ANUMBER);

    INSERTION of REM in VOLA

    TOGETHER TO DEFINE

    Insert in VOLA (SRNO, ONE) values (1,237.94);

    Insert in VOLA (SRNO, ONE) values (2, null);

    Insert in VOLA (SRNO, ONE) values (3,203.565);

    Insert in VOLA (SRNO, ONE) values (4,170.69);

    Insert in VOLA (SRNO, ONE) values (5,113.67);

    Insert in VOLA (SRNO, ONE) values (6,93.6);

    Insert in VOLA (SRNO, ONE) values (7,82.03);

    Insert in VOLA (SRNO, ONE) values (8,66.675);

    Insert in VOLA (SRNO, ONE) values (9,63.59);

    Insert in VOLA (SRNO, ONE) values (10,61.415);

    Insert in VOLA (SRNO, ONE) values (11,60.015);

    Insert in VOLA (SRNO, ONE) values (12,58.235);

    Insert in VOLA (SRNO, ONE) values (13,57.805);

    Insert in VOLA (SRNO, ONE) values (14,56.965);

    Insert in VOLA (SRNO, ONE) values (15, null);

    Insert in VOLA (SRNO, ONE) values (16, null);

    I have to remove the NULL values in column 1, the problem is that the position of the NULL values are not fixed, and it can be any position. If all the lines of the columns are null, then throw it away.

    If multiple NULL values are here so I have to do the math as follows to update null with the eigenvalues

    1. If the first line is null then take the 2nd value in row and update it.

    2. If the lines between both is null then take avg of prev and next value not null and refresh it.

    3. If the last value in the column is null, then then take prev and update, in this case last two are null, so I have to take value of prev 14 value line update in

    15th and 16th ranks.

    I want to put this pl/sql logic, somehow, that I thought have loop and counter aapproach and loops through the elements and check and update.

    But always looking for something better before looking to write code. No idea or help will be useful for me.

    I * think * you are looking for something like:

    WITH VOLA (SRNO, ONE)

    AS (select 1,237.94 from all the double union)

    Select 2, union null value double all the

    Select 3,203.565 from all the double union

    Select 4,170.69 from all the double union

    Select 5,113.67 from all the double union

    Select 6,93.6 from all the double union

    Select 7,82.03 from all the double union

    Select 8,66.675 from all the double union

    Select 9,63.59 from all the double union

    Select 10,61.415 from all the double union

    Select 11,60.015 from all the double union

    Select 12,58.235 from all the double union

    Select 13,57.805 from all the double union

    Select 14,56.965 from all the double union

    Choose 15, null of union double all the

    SELECT 16, NULL FROM dual)

    GET_VALUES (SELECT SRNO, ONE ACE,

    , LAST_VALUE (WE IGNORE NULLS) (ORDER BY SRNO CSA ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS PREVIOUS_VALUE

    , first_VALUE (ONE IGNORE NULLS) over (ORDER OF SRNO CSA ROWS BETWEEN 1 SUITE AND FOLLOWS without TERMINALS) AS NEXT_VALUE

    FROM VOLA)

    SELECT SRNO, ONE, CASE

    WHEN IT IS NOT NULL, THEN WE

    OTHER CASES

    WHEN PREVIOUS_VALUE IS NOT NULL AND IS NOT NULL THEN (PREVIOUS_VALUE + NEXT_VALUE) NEXT_VALUE / 2

    WHEN THE PREVIOUS_VALUE IS NOT NULL, THEN PREVIOUS_VALUE

    WHEN THE NEXT_VALUE IS NOT NULL, THEN NEXT_VALUE

    END

    END AS NEW_VALUE

    OF GET_VALUES

    /

    HTH

  • Remove the default value drop-down list

    I am currently working with Acrobat Pro XI version. I want to know if it is possible to remove the default value in a drop-down list.

    When the list less than 4 elements, it is possible to deselect the default value by pressing the spaces below. However, when there are no more elements, it is more possible.

    I read that you need to include white space as a component in the list of elements, however, then you will see an empty list item when people work with the pdf that is not preferable.

    So, nobody how to remove the default value in a drop-down list?

    Thank you!

    OK, I found a perfect solution to my problem by using FormsCentral for Acrobat. Here's what you need to do:

    Step 1:

    -Open FormsCentral

    -Create new form (choose the blank form)

    -Click the drop-down menu to create a new drop-down list

    -Fill out the items in the list by clicking on the timeline (you can also add a label if you want)

    -Click on: file > save as PDF form...

    Step 2:

    -Open the PDF saved (you will now see a blank pdf with a menu drop-down)

    -Click on: Tools > forms > Edit Form (when a pop-up window indicates that you should save a copy of the document in order to make changes, press 'Save a copy' and open the file with Acrobat pdf copy)

    -Select the drop-down list, the drop-down list to copy and paste it into the desired document

    Now you have a drop down without a default choice. Remember that you can not change the items in the drop-down list, because we will choose a default choice and you must use the copy pdf file once again. As long as you do not click on a list item, it is not choose a default choice.

    It is not a perfect solution, but it works for me.

    Good luck and thanks!

  • Call doSubmit() with custom value does not update process

    I have a page with a standard form that has a "Save" button, but also a button that I have manually created via an anonymous PL/SQL block in the source of the element of a field on the form. (I did because I was already using a PL/SQL block to display the value of the item, but wanted to update the button appear immediately next to him, rather than somewhere on the page template.)

    Originally, this button was just a simple redirect to a separate detail page, but I found that if the user has made changes to the form, then click on this button, these changes would be lost. So I changed it to a call doSubmit() instead. But I had to distinguish between the user pressing the "Save" button and the custom button, the button call doSubmit ('CUSTOM'). I then created a branch that has verified the value of demand and went to the appropriate page that was pressed.

    What I found was that the process to update the underlying table for the form had not shot, even if it is unconditional, and therefore updates the original form have been lost.

    I eventually worked around this by changing the button so that instead of calling doSubmit with a custom value, it calls a JavaScript function that: 1) define a hidden field to '1' and 2) called doSubmit ('SAVE'). Then, I changed the direction to look at the value of this hidden field, rather than the value of the request. That has worked well.

    So this got me thinking: why my original implementation did not work?

    I suspect that doSubmit() only works to the custom of the values if you have defined a real button in the designer of the ApEx and configured with a name for this custom value. The HTML code for my button seems indistinguishable from a button created by ApEx, I think that there is something that happens behind the scenes to make doSubmit() work simply with a random value.

    Can anyone confirm or deny this hypothesis?

    Hello

    Could this be your problem:
    If you have a treatment of automatic line (DML), which only fires from below, if I understand correctly

    Valid Update Request Values: SAVE, APPLY CHANGES, UPDATE, UPDATE ROW, CHANGE, APPLY, APPLY%CHANGES%, GET_NEXT%, GET_PREV%
    Valid Insert Request Values: INSERT, CREATE, CREATE_AGAIN, CREATEAGAIN
    Valid Delete Request Values:DELETE, REMOVE, DELETE ROW, DROP
    

    At least on Apex 3.2

    BR, Jari

  • VO with static values

    I WANT TO CREATE A MESSAGE OF CHOICE WITH STATIC VALUES. FOR THIS I HAVE CREAT VO
    Name: DeviseVO
    attributes: RowKey (primaryKey, number)
    Values (String)

    I creat the initialiserDevise() method and call it from the PR

    Public Sub initialiserDevise()
    {
    String [] values = {'Dinar', 'Euro', 'Dollar'};
    DeviseVOImpl pervo = getDeviseVO1 ();
    If (Pervo.getFetchedRowCount () == 0)
    {
    for (int i = 0; i < 3; i ++)
    {
    pervo.executeQuery ();
    Bow of row = pervo.createRow ();
    pervo.insertRow (prow);
    Try
    {
    prow.setAttribute ("RowKey", new Number (i));
    prow.setAttribute ("values" [i]);
    pervo.getCurrentRow () .validate ();
    }
    catch (Exception ex)
    {
    pervo.getCurrentRow () .remove ();
    }
    }
    }
    pervo.executeQuery ();
    System.out.println (Pervo.getFetchedRowCount ());
    }

    My problem that the list is as empty and the display method 0

    Help please

    Thank you

    Hello

    This requirement is quite simple that instead of writing code you can write query in English like this

    Select "Dinar" dual union select 'Euro' from dual union select 'Dollar' of the double

    and after that, you need not to run the query on this OAF do by itself, even then I suggest you to create a list of choices for this and then later you want to add the value or delete what can be done without changing the code.

    Hope this will help :)

    Kind regards
    Out Sharma

  • Siri in him sending text with the value 'NULL '.

    When I say, "Siri, text my wife, 'X', ' Siri responds correctly,"here is your message to Jill: 'X'. "" "  "Ready to send it?"  I say 'Yes' and sends the message.  As soon as I get a text from my carrier saying the recipient of the message was invalid.  100% of the time, I see that Siri has sent a text with the value NULL.

    I tried to restart my phone.  I tried to remove and re-add my contacts.  Anyone else having this problem?  Someone knows how to solve?

    If it's by the carrier, you should contact them and see what they receive in return for their side. Ive had Siri send messages for me and I have never seen this one IOS.

  • How to do a search with the value of the results being a hyperlink?

    Hi all

    I I created two tables, the table, one is a short version of the table 2 with the options from the drop-down list so that only the information you want are pulled up. so all my search formulas work to pre fill the columns following except where I'm doing the shoot hyperlinks table two as the results (values). I do what I've done for all the other search values (search for) (search - where) (results values) but I either get a sign of error or I get an empty cell. According to all other forms of research simply do not hyperlinks as results-values work... Please help. Thanks to anyone in advance!

    the LIEN_HYPERTEXTE function in numbers is described as follows:

    The LIEN_HYPERTEXTE function creates a clickable link that opens a Web page or a new e-mail message.

    • Hyperlink (url, link-text)
      • URL: a standard universal resource locator. URL is a string value which must contain a string correctly formatted Universal Resource Locator.
      • text link: an optional string value that specifies the text that appears as a clickable link in the cell. If the link text is omitted, the url is used as link text.

    As you can see, you can reference a page web (the URL may have on your local file system) or e-mail.  Maybe post an example of what you have will help us help you

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • How to capture the time entry with the value 'default' as SYSDATE

    Hello

    I created "entry receipt" form by using wizard.

    Hidden CREATED_ON column is defined with the value 'default' as SYSDATE.

    However, it's only complete part of date, but time is not included when I discovered that in the report.

    Format under 'source' mask is defined as "MON-DD-YYYY HH24:MI:SS" during form entry.

    Under the column definition format mask is "HH24:MI:SS MON-DD-YYYY" under the report.

    Need help to fix this problem.

    I use APEX worm 4.2.6

    Thank you

    -Anand

    Is it viable to not include the column in the form of the APEX and have a default value to the column in the table?

    ALTER table my_table change created_on default sysdate;

  • How to check the page dirty with default values existing in viewObject?

    Hi all

    I use JDeveloper 11.1.1.4.

    I have two pages in my application. I am browsing for page2 page1.

    Before opening page 2 I created new line page 2 notice of object using method 'Create Insert()' with some default values by using the ViewRowImpl class.

    My problem is that I have a button to return to Page 2. If I click the back button, then check the Application module is dirty or not.

    But it always shows AM is dirty due to I'm setting some default values in ViewRowImpl. If I avoid the default values in ViewRowImpl then AM dirty check works fine.

    My Question is how to check the AM (or) dirty Page with default values in the object view?

    My bean Codes:

    Links DCBindingContainer = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    DataControl dc = bindings.findDataControl("AppModuleDataControl");

    ApplicationModuleImpl am = ((ApplicationModuleImpl) dc.getDataProvider ());

    If (am.getDBTransaction (.isDirty (()))

    {

    return "Page is dirty."

    }

    My Jspx Codes:

    < af:commandLink id = "cl6" text = '2 '.
    shortDesc = "Add Row in Page2"
    actionListener = "#{bindings." Action CreateInsert.execute}' = 'Edit' >

    Thank you

    David...

    see this

    http://www.techartifact.com/blogs/2013/11/how-to-check-ifdirty-is-modified-for-view-object.html

    http://www.jobinesh.com/2011/05/checking-for-dirty-data.html

  • Need to remove the advanced values in VMX file

    Former Director elected to harden all VMs VMX files in order to avoid interruptions in service unwanted individuals manual installation of the VMware tools upgrades.

    I agree with him and understand in previous versions, it was a good idea to disable these but now with 5.1 with the fact that we have more to restart for the modernization of the tools happen my life has become much more complicated and we constantly have problems with VM with mounted tools and no way forced to disassemble the tools.

    I am looking for PowerCLI script to remove these advanced values in the VMX file for all the virtual machines attached to a vCenter. I guess these are the following values:

    isolation.tools.autoInstall.disable = true

    isolation.tools.guestInitiatedUpgrade.disable = false

    insulation. Tools.connectable.Disable =true

    If there are other values that I should check, please let me know and I will review the VMX file.

    This is another option, but lines will remain in the VMX, albeit with different values

    You can do it with this script

    $vm = Get-VM -Name MyVM
    
    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec$spec.tools = New-Object VMware.Vim.ToolsConfigInfo
    
    $extra1 = New-Object VMware.Vim.OptionValue$extra1.Key = "isolation.tools.autoInstall.disable"$extra1.Value = "false"$spec.ExtraConfig += $extra1$extra2 = New-Object VMware.Vim.OptionValue$extra2.Key = "isolation.tools.guestInitiatedUpgrade.disable"$extra2.Value = "true"$spec.ExtraConfig += $extra2$extra3 = New-Object VMware.Vim.OptionValue$extra3.Key = "isolation.tools.connectable.disable"$extra3.Value = "flase"$spec.ExtraConfig += $extra3
    
    $vm.ExtensionData.ReconfigVM($spec)
    

Maybe you are looking for