How to generate several lines from a single line

Hi, using Oracle 11 g R2.

Looking for a way to display the result of a query where a column value is a text similar to the following field. There is only 1 row.

create table testlist (col1 varchar2 (50))

insert into testlist values (' ' 845, 999, ABC ")

The values are always separated by commas. Looking for display the result as follows

845

999

ABC

Hello

Since you have only 1 row in the table, you can do this:

SELECT REGEXP_SUBSTR (col1

, '[^,]+'

1

LEVEL

), Element

OF testlist

CONNECT BY LEVEL<= regexp_count="" (="">

, '[^,]+'

)

;

Output:

AGENDA

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

845

999

ABC

Tags: Database

Similar Questions

  • How to generate random numbers from 1 to 5

    How to generate random numbers from 1 to 5

    -1110340081

    Thank you I ended up

  • How to combine several PDF in a single

    I can't find out how to combine several PDF in a single document with Illustrator.

    Help, please!

    Brooke,

    It depends on your version.

    In older versions (one page PDF), you can

  • How to generate a line in the report to calculate the total?

    Hello:

    I need help to generate a report. In an accounting report, I need to make the sum for each customer about the outstanding balance. The format of the report is the following:

    Invoice #, date of invoice, invoice, amount paid amount paid date, strike, sale

    Customer name: Baker Express / name of the debtor: Kurt Weiss inc.

    137308001, 18/04/2012, 438.07, 537.07, 05/06/2012, (99)
    137308002, 18/04/2012, 10, 100, 90, 05/06/2012

    ...

    customer Total: total payment: 627.07, total outstanding amount: (99)

    another pair of customer / debtor
    ...


    My question is how to generate the payment total and total outstanding balancefor each pair of client and the debtor. And there are several pairs. I tried to use Group by, but how do I display each tuple of invoice as well in the report?

    Any help would be appreciated.

    Sam

    One method would be to use the rollup in your SQL
    http://www.Oracle-base.com/articles/Misc/rollup-cube-grouping-functions-and-grouping-sets.php

  • How to upgrade several lines

    Hello world!

    As I said... is it possible to update several lines in the studio ODI 12 c?

    Thanks anyway!

    Can you close the thread and then marking it as answered.

  • How to add several lines to the CreateWithParameters method

    Hello
    can someone tell me how to insert several rows in a table by using the CreateWithParameters method, which I use in a taskflow.

    That's why you get a null pointer...
    Add the iterator in this page or call the method in the second page... both should work... :)

  • Q. how get several results from a single column in a recordset using PHP

    Hello world

    I hope someone can help. I have a column called categories and about 5 categories listed. I want to show all the products listed in say 2 categories. I don't have that basic php skills so know only how to pass a value to the url to display the products of 1 category for example

    Select *.

    PRODUCT

    Category WHERE colname =

    $colname = $_GET ['category'];

    URL... page.php? category = result

    Question is how can I get products in several categories to show for instance all the products of the categories "fruits", "dairy products", 'meat '.

    Your help will be much appreciated, because I'm tired of beating my head against the wall. (should invent a pillow of wall PHP and sell online)

    Thank you

    $colname1 = $_GET ["category1"];

    $colname2 = $_GET ["Category2"];

    $colname3 = $_GET ["category3"];

    Select *.

    PRODUCT

    Category WHERE the ('$colname1', '$colname2', '$colname3')

    > Your help will be very appreciated because I'm tired of beating my head against the wall

    My guess is that you are trying to build a web application without first learning the basics of PHP and SQL. It is certainly the hard way.

  • SQL query, generate several lines in a value in a field

    I use the Oracle database. Imaging I have a table with a row as follows

    col1 |  col2. COL3

    "Str1" | "Str2". 4

    The value of col3 = 4 is expected to generate 4 rows as follows:

    col1 |  col2. COL3

    "Str1" | "Str2". 1

    "Str1" | "Str2". 2

    "Str1" | "Str2". 3

    "Str1" | "Str2". 4

    After several hours in front of the screen and stil no chance - how do I create such a select query?

    It will work

    Select * from test_table:

    COL1 COL2 COL3

    str1 str2 2

    strA, strb 4

    STRX deltas 8

    WITH t(col1,col2,col3) AS
            (
            select col1,col2,col3 from test_table
             union all
             select col1,col2,col3-1 from t where col3>1)
    SELECT *
      FROM t
      order by col1,col3;
    

    OUTPUT:

    COL1 COL2 COL3

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

    str1 str2 1

    str1 str2 2

    strB Stra 1

    strA, strb 2

    strA, strb 3

    strA, strb 4

    deltas STRX 1

    STRX deltas 2

    deltas STRX 3

    STRX deltas 4

    STRX deltas 5

    STRX deltas 6

    STRX deltas 7

    STRX deltas 8

    See you soon,.

    Manik.

  • How to transfer several photos from one folder to another

    I want to delete a number of photos in my folder and then transfer some blocks of them to other folders to better organize. I know how to remove one at a time, but I don't know how to highlight a bunch of them for moving.  They are coming up with numbers, like 079, 080, 081 etc but not on a list where I can highlight.  I also want to do the same with several short videos I have.  By the way, I have transferred all this media from my iphone / ipad and everything came automatically - that is why I need now to separate and organize especially if I want to send copies to parents and friends.

    I want to delete a number of photos in my folder and then transfer some blocks of them to other folders to better organize. I know how to remove one at a time, but I don't know how to highlight a bunch of them for moving.  They are coming up with numbers, like 079, 080, 081 etc but not on a list where I can highlight.  I also want to do the same with several short videos I have.  By the way, I have transferred all this media from my iphone / ipad and everything came automatically - that is why I need now to separate and organize especially if I want to send copies to parents and friends.

    ==========================================
    You can select multiple by holding your CTRL key while left
    by clicking on the thumbs or file names.

    You can also select groups of photos by selecting one...
    While holding down your shift key and select another further
    fixing the list. All photos between the two selected will be
    chosen too.

    Move photos from one folder to another.

    With the thumbnail selected... type... CTRL + x. sa is the
    keyboard shortcut for "cut". Selected thumbnails are
    bland and appear grey.

    Open the folder that you want to move the photos to, and then type...
    CTRL + V. sa is the keyboard shortcut for paste.

  • How to delete several lines in the details Table with PRIMARY KEY = ("VID", "LINEITEM")?

    Mr President

    My worm Jdev is 12.2.1.

    I have master tables / details.

    I have 2 lines for each PRIMARY KEY = ("VID", "LINEITEM") as below in the Details table.

    delete.png

    Please help how to get a button on a jsf page to remove these two lines at a time.

    Concerning

    So, in your app (data model) module, you have a master relationship / typical retail:

    And the relationship between them is based on some ViewLink

    Now go to the ViewLink, relationship, accessor.

    Take a look at the Destination accessor.

    Generate accessor object to check and give a name Acessor

    Then go to the master VO, Java and Include accessor, the class generate a display line:

    Go to the class view Java generated line, you'll find a method with the name of the accessor of the previous step, in the form of:

    public RowIterator getYourDetails...or_whaterever_IsAccessorName..() {
    }
    

    Now, in the same Java class, write the following Java method:

    public void removeDetails(){
      RowIterator details = getYourDetails...or_whaterever_IsAccessorName..(); // it is RowIterator over all details
      Row r = details.first();
      while (r != null) {
          r.remove();
          r = details.next();
      }
    }
    

    This method on the Cilent export line Interface:

    Finally, pass the data controls and drop this operation on the form as a button...

  • How to post several lines in oracle FORM

    Hello

    I created a custom form that has a header block and a block of retail. the retail block can have multiple lines. I have a requirement that lines (multi-line) block detail data will be validated during the recording of the record. Please indicate how we can do?

    Please note that the data are not saved and yet, it will be validated during registration or any click of a button.

    Please notify. It is urgent.

    Thank you

    Pirre

    Make the echo of Christian question... What do you mean by "validating"?  You have not yet defined what it means in your scenario!

    Is your retail block a block of the base table, or a control block?  Rather than the trigger key - Commit, you could use the triggers we insert or we--update since these will be triggered for each line that oracle Forms will insert or update.  If you want to keep your validation in the trigger key code - Commit, you will need to loop through all the rows in your detail block and validate each line manually.  If the validation logic is the same for inserts and updates - you can put this logic in a unit of program (procedure) and then call this procedure in the Insert and update triggers on.

    What about using the trigger when-validate-Record?  This trigger fires as you navigate from one line to the other, but it will save a loop block (if you continue to use the "enter" key).

    Craig...

  • How to combine several pages from different files together?

    I converted a Word document to PDF, now I want to combine pdf pages to the file, how can I do?

    Hi imherelawd,

    I see you have Abobe PDF Pack, you can use the feature files to combine to combine up to 12 files in a single PDF file. But, this function combines the whole files, the pages are not specific. If that's your goal, you will need to use Acrobat, which allows you to insert selected pages from a PDF in another. If you do not have Acrobat, you can try it free for 30 days. Please visit www.adobe.com/products/acrobat.html.

    Best,

    Sara

  • generate several lines of each row in a table

    Hi all, consider the following data
    with data1 as
    (
      select 1 id, 0 cust_sh, null mx_sh, 123 cust_coll from dual union all
      select 2 id,0 cust_sh, 0 mx_sh, 0 cust_coll from dual union all
      select 3 id,456 cust_sh, 890 mx_sh, 123 cust_coll from dual 
    ),
    data2 as
    (
      select 'cust_sh' col_nm, 'ABC' nm from dual union all
      select 'mx_sh' col_nm, 'BDC' nm from dual union all
      select 'cust_coll' col_nm, 'HGR' nm from dual 
    )
    what I'm trying to do here is to join the two tables sort and produce this output
    id  nm         amt
    =====================
    1   HGR        123
    3   ABC        456
    3   BDC        890
    3   HGR        123
    That's how I get this result. Data1 has lines with the ID and the columns with quantities such as cust_sh, etc.
    data2 bearing the name of the column in data1 under col_nm and an additional column as nm.

    for each line of Data1, I should take the amount column, look in database2 and the data1 amount is greater than 0.
    then display the output.

    for example, to get data1 row1. cust_sh is set to 0, so we don't look this column in Database2. mx_sh is set to null, which is not greater than 0, then us none.
    cust_coll has the value 123 so we wait for this column in Database2. This is the third row in Database2. Therefore, view us the id and the amt of Data1 and data2 nm.

    for line two of Data1, all after id columns are 0. don't have no need to display the output. only when the amount is greater than zero, we watch in Database2.

    third row, cust sh has value 456 so we expect in database2 and we found in the first row. mx_sh has a value of 890 (greater than 0) so again once we look at Database2 and display the output.

    can someone help me with a query that produces the output above?

    Thanks in advance

    OK, two more options:

    WITH pivot_data1 AS (
      SELECT id, 'cust_sh' as col_nm, cust_sh as amt
      FROM data1
      WHERE cust_sh > 0
      UNION ALL
      SELECT id, 'mx_sh', mx_sh
      FROM data1
      WHERE mx_sh > 0
      UNION ALL
      SELECT id, 'cust_coll', cust_coll
      FROM data1
      WHERE cust_coll > 0
    )
    SELECT d1.id
         , d2.nm
         , d1.amt
    FROM pivot_data1 d1
         JOIN data2 d2 ON d2.col_nm = d1.col_nm
    ;
    
    WITH pivot_data1 AS (
      SELECT id
           , case i when 1 then 'cust_sh'
                    when 2 then 'mx_sh'
                    when 3 then 'cust_coll'
             end as col_nm
           , case i when 1 then cust_sh
                    when 2 then mx_sh
                    when 3 then cust_coll
             end as amt
      FROM data1
           CROSS JOIN ( SELECT level i FROM dual CONNECT BY level <= 3 )
    )
    SELECT d1.id
         , d2.nm
         , d1.amt
    FROM pivot_data1 d1
         JOIN data2 d2 ON d2.col_nm = d1.col_nm
    WHERE d1.amt > 0
    ;
    
  • How to send several check-in a single emial by oracle alert

    Guy

    Send us a notification alert oracle based on all records, but my question about several account send to relate to the employee of Department (email) in a single email, admit every day our employee leasing more then an employee supposed 10, now we want to admin mail service to the agreement of the employee, such as car, parking, sitting arrangement etc. , in this scenario system will send 10 individual e-mail anyone of concern, it will take a lot of time.

    But I want to send all employee rental information (empno, name, Department, location, etc.) in simple email to the service of anxiety.


    Please advice me how to this.any idea

    Published by: oracle0282 on December 15, 2010 03:18

    It depends on how you have set your alert.
    (1) If your alert is the type "event based ', then it goes off as soon as a new employee record is registered." Therefore, there is no way to group them.
    (2) If your alert is periodic (hourly for example), then you can write what is called a summary alert which will include information for all new employees created in an hour.
    Look at the following
    http://BBS.erp100.com/attachments/day_081119/1.htm

    Hope this helps
    Sandeep Gandhi
    OMKAR Technologies Inc.
    Techno-Functional consultant

  • How to get several lines with series C 9501 running with SoftMotion on a cRIO 9074 modules?

    Hello

    I'll have set up many of the variable axes defined by the user with two modules in series c 9501 running on a Compact RIO 9074 stepper.

    I started with the example of "9501 Stepper Drive (Getting Started)", which worked fine with a simple variable user defined axis (Test-interactive panel, SoftMotion functionality on the host).

    I need to control 2 axes and I could not find any help on adding a second axis, so I came up with the following approach. My approach was to expand the FPGA VI in a way to add features to the second variable axis defined by the user, so I did the following steps:

    1. Add a new variable axis defined by the user.

    2. Add the variables defined by the same user as the first axis had during the second axis.

    3. a copy of global variables that the first axis necessary to use independent global variables for the second axis.

    4. develop the FPGA VI while-loops with the circuits of same for axis 2 and ensure that the circuits for axis 2 use their own global variables, the right modules, their user-defined variables and change the index of the axis from 0 to 1 (don't know exactly how the axis index is defined).

    4B. I also tried to copy all the loops for each axis had their independent loops. Then adapt the global variables, modules, the variables defined by the user, index of the axis.

    The FPGA VI compiles and runs, but when I get to the Panel of interactive Test for both axes and try to enable them, it throws an error-70228 (Controller unable to confirm that the drive is enabled).

    I'm doing something wrong? Is it perhaps a simpler way to get two 9501 modules working with SoftMotion?

    I can provide my two examples of published projects (same loop loop / independent), if necessary.

    LabVIEW installation:

    LabVIEW 2014f1

    Module FPGA 2014

    In time real Module 2014

    SoftMotion 2014f1

    cRIO-drivers 2014f1

    Xilinx tools 14.7 2014

    I hope someone can help me, thanks in advance.

    I managed to make it work.

    I was missing that a Subvi in the FPGA VI engine control missed their axis index 0. I couldn't even they worked with an index of the axis until I looked into the block diagram of those.

    So what happened was that my routines on the second axis disabled immediately the first axis because of bad axis index.

    Definition of the index of 0 and 1 axis (axes 1 and 2) for each unique Subvi of motor control was what was missing.

Maybe you are looking for