Associate Table1_PK into multiple rows in Table2

Hi,
I have 2 tables... TableOne and TableMany. The values for input are all on the same page. I'm trying to achieve... Inserting the TableOne values (no problem - created a process for insert)... once this is done I want to insert multiple rows into TableMany which associates the PK from TableOne insert to multiple values selected from a Multiselect List. I have setup the coding to obtain the individual elements in the multiselect list but don't know the best way to obtain the PK.
Ideally I'd be able to set the ProcessInsertTableOne sequence to lower than ProcessInsertTableMany and store the PK (created by table PK sequence trigger) into a page item and then use this in the 2nd insert process? Been trying to work around this but still a bit novice in SQL and newbie to ApEx.
Any help or guidance in this regard would be appreciated.
Thanks.
Rory

You should use 2 pages. Input into master record on one page then put a link in and branch to another page containing the details.
Gus

Similar Messages

  • Splitting comma seperated column data into multiple rows

    Hi Gurus,
    Please help me for solving below scenario. I have multiple value in single column with comma seperated values and my requirement is load that data into multiple rows.
    Below is the example:
    Source Data:
    Product         Size                                 Stock
    ABC              X,XL,XXL,M,L,S                 1,2,3,4,5,6
    Target Data:
    Product         Size                                 Stock
    ABC              X                                     1
    ABC              XL                                   2
    ABC              XXL                                 3
    ABC              M                                    4
    ABC              L                                      5
    ABC             S                                        6
    Which transformation we need to use for getting this output?
    Thanks in advance !

    Hello,
    Do you need to do this tranformation through OWB mapping only? And can you please tell what type of source you are using? Is it a flat file or a table?
    Thanks

  • I need to divide selected row into multiple rows when i navigate  ADF 11g

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I need to divide selected row into multiple rows when i navigate to other page . Scenario - in first page i'm displaying some records with columns like empno , empstatus , empworkdepts ,curdepts
    Here empworkdepts gives the numeric number like no of departments work shifts 3 or 4 or 5. when i select any particular employee and fire next button to navigate next page.I have to divide the selected employee with same information into multiple times based on the empworkdepts value.
    empno empstatus empworkdepts curdept
    001 eds 2 TS
    002 hr 1 FO
    003 eds 4 TS
    *004 eds 3 TS*
    now i selected employee 004 , when i navigate to next page.
    Empno EmpStatus EmpWorkDepts CurDept
    004 eds 3 TS
    004 eds 3 TS
    004 eds 3 TS
    i did with java code in bean .but not stable .
    any help............
    thanks advance.............
    Edited by: user9010551 on May 5, 2010 10:48 PM
    Edited by: user9010551 on May 10, 2010 11:31 PM

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

  • Easy Question: How to split concatenated string into multiple rows?

    Hi folks,
    this might be an easy question.
    How can I split a concatenated string into multiple rows using SQL query?
    INPUT:
    select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
    Expected output:
    data
    AAA
    BBB
    CCC
    DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
    Thanks,
    Tomas

    Here is the SUBSTR/INSTR version of the solution:
    SQL> WITH test_data AS
      2  (
      3          SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
      4  )
      5  SELECT  SUBSTR
      6          (
      7                  DATA
      8          ,       INSTR
      9                  (
    10                          DATA
    11                  ,       ','
    12                  ,       1
    13                  ,       LEVEL
    14                  ) + 1
    15          ,       INSTR
    16                  (
    17                          DATA
    18                  ,       ','
    19                  ,       1
    20                  ,       LEVEL + 1
    21                  ) -
    22                  INSTR
    23                  (
    24                          DATA
    25                  ,       ','
    26                  ,       1
    27                  ,       LEVEL
    28                  ) - 1
    29          )       AS NEW_STRING
    30  FROM    test_data
    31  CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
    32  /
    NEW_STRING
    AAA
    BBB
    CC
    DDDD

  • Split single row into multiple rows containing time periods

    Hi,
    I have a table with rows like this:
    id, intime, outtime
    1, 2010-01-01 00:10, 2010-01-3 20:00
    I would like to split this row into multiple rows, 1 for each 24hr period in the record.
    i.e. The above should translate into:
    id, starttime, endtime, period
    1, 2010-01-01 00:10, 2010-01-02 00:10, 1
    1, 2010-01-02 00:10, 2010-01-03 00:10, 2
    1, 2010-01-03 00:10, 2010-01-03 20:00, 3
    The first starttime should be the intime and the last endtime should be the outtime.
    Is there a way to do this without hard-coding the 24hr periods?
    Thanks,
    Dan Scott
    http://danieljamesscott.org

    Thanks for all the feedback, Dan.
    It appears that the respective solutions provided will give you: a) different resultsets and b) different performance.
    Regarding your 'truly desired resultset' you haven't answered all questions from my previous post (there are differences in the provided examples), but anyway:
    I found that using CEIL or ROUND makes quite a difference, using my 'simple 3 record testset' (30 records vs. 66 records got initially returned, that's less than half of the original). That's quite a difference. However, I must call it a day (since it's almost midnight) for now, so there's room for more optimizement and I haven't thoroughly tested.
    But this might hopefully make a difference performancewise when compared to my previous 'dreaded example':
    SQL> drop table t;
    Table dropped.
    SQL> create table  t as
      2  select 1 id, to_date('2010-01-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-01-03 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
      3  select 2 id, to_date('2010-02-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-02-05 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
      4  select 3 id, to_date('2010-03-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-03-03 00:10', 'yyyy-mm-dd hh24:mi') outtime from dual;
    Table created.
    SQL> select id
      2  ,      max(intime)+level-1 starttime
      3  ,      case
      4           when level = to_char(max(t.outtime), 'dd')
      5           then max(t.outtime)
      6           else max(t.intime)+level
      7         end outtime
      8  ,      level period      
      9  from   t
    10  connect by level <= round(outtime-intime)
    11  group by id, level
    12  order by 1,2;
            ID STARTTIME           OUTTIME                 PERIOD
             1 01-01-2010 00:10:00 02-01-2010 00:10:00          1
             1 02-01-2010 00:10:00 03-01-2010 00:10:00          2
             1 03-01-2010 00:10:00 03-01-2010 20:00:00          3
             2 01-02-2010 00:10:00 02-02-2010 00:10:00          1
             2 02-02-2010 00:10:00 03-02-2010 00:10:00          2
             2 03-02-2010 00:10:00 04-02-2010 00:10:00          3
             2 04-02-2010 00:10:00 05-02-2010 00:10:00          4
             2 05-02-2010 00:10:00 05-02-2010 20:00:00          5
             3 01-03-2010 00:10:00 02-03-2010 00:10:00          1
             3 02-03-2010 00:10:00 03-03-2010 00:10:00          2
    10 rows selected.
    SQL> By the way: I'm assuming you're on 10g, is that correct?
    Can you give us some information regarding the indexes present on your table?

  • Urgent: How to break 1 Row into Multiple Rows

    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product Sub Product Name Age
    New Car Nissan Tom 49
    New Car Nissan Jack 36
    Old Car Audi Sam 24
    Old Car Jaguar Pint 26
    Old Car Audi Smith 41
    I need to be able to fetch the above data in the below fashion
    Product Sub Product Name Age
    New Car
    Nissan
    Tom 49
    Jack 36
    Old Car
    Audi
    Sam 24
    Smith 41
    Jaguar Pint 26
    Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

  • Cats ESS view - into multiple rows when we release times or refresh them

    Dear ALL,
    We are using the record working times and when we enter the data for the week for 5 days each with 8 hours a day in one row in portal. Once we refresh or review that page it is resulting into multiple rows, like for 5 days five rows each row containing an entry for each day. how can we avoid this, we want all entries maintained into one row only.
    Help is appreciated.
    Thanks and Regs,
    Raj

    Made some changes in Data entry profiles

  • Please - immediate help needed parsing csv values into multiple rows

    Hello, we have a very immediate need to be able to parse out a field of comma separated values into individual rows. The following is an example written in SQL Server syntax which does not work in Oracle.
    The tricky part is that each ROUTES can be a different length, and each CSV can have a different number of routes in it.
    Here is an example of the table ("Quotes") of CSV values I want to normalize:
    TPNUMBER ROUTES
    1001 1, 56W, 18
    1002 2, 16, 186, 28
    Here is an example of what I need it to look like:
    TPNUMBER ROUTES
    1001 1
    1001 56W
    1001 18
    1002 2
    1002 16
    1002 186
    1002 28
    Here is the "Tally" table for the query below:
    ID
    1
    2
    3
    4
    5
    6
    7
    And finally, here is the query which parses CSV values into multiple rows but which does not work in Oralce:
    SELECT TPNUMBER,
    NullIf(SubString(',' + ROUTES + ',' , ID , CharIndex(',' , ',' + ROUTES + ',' , ID) - ID) , '') AS ONEROUTE
    FROM Tally, Quotes
    WHERE ID <= Len(',' + ROUTES + ',') AND SubString(',' + Phrase + ',' , ID - 1, 1) = ','
    AND CharIndex(',' , ',' + ROUTES + ',' , ID) - ID > 0
    It may be necessary to use a cursor to loop through the CSV table and process each row (a loop within another loop...) but this is beyond my comprehesion of PL/SQL.
    Many thanks in advance for your advice/help.
    apk

    Not sure what you are trying to do with the last step, but this should work for the first part. I assume you would use sqlldr but I just did inserts instead. You might need more than 5 "routes" in the csv. You could put some reasonable max on that number of columns:
    SQL>create table t_csv
    2 (TPNUMBER varchar2(20),
    3 ROUTE_1 VARCHAR2(5),
    4 ROUTE_2 VARCHAR2(5),
    5 ROUTE_3 VARCHAR2(5),
    6 ROUTE_4 VARCHAR2(5),
    7 ROUTE_5 VARCHAR2(5),
    8 ROUTE_6 VARCHAR2(5) );
    Table created.
    SQL>INSERT INTO t_csv (TPNUMBER,ROUTE_1,ROUTE_2) values( '1001 1', '56W', '18' );
    1 row created.
    SQL>INSERT INTO t_csv (TPNUMBER,ROUTE_1,ROUTE_2,ROUTE_3) values( '1002 2', '16', '186', '28');
    1 row created.
    SQL>create table t_quotes(
    2 tpnumber NUMBER,
    3 routes VARCHAR2(5));
    Table created.
    SQL>DECLARE
    2 L_tpnumber NUMBER;
    3 L_route VARCHAR2(5);
    4 begin
    5 for rec in (select * from t_csv) loop
    6 L_tpnumber := SUBSTR(rec.tpnumber,1,INSTR(rec.tpnumber,' ')-1);
    7 L_route := SUBSTR(rec.tpnumber,INSTR(rec.tpnumber,' ')+1);
    8 insert into t_quotes values( L_tpnumber, l_route );
    9 if rec.route_1 is not null then
    10 insert into t_quotes values( L_tpnumber, rec.route_1 );
    11 end if;
    12 if rec.route_2 is not null then
    13 insert into t_quotes values( L_tpnumber, rec.route_2 );
    14 end if;
    15 if rec.route_3 is not null then
    16 insert into t_quotes values( L_tpnumber, rec.route_3 );
    17 end if;
    18 if rec.route_4 is not null then
    19 insert into t_quotes values( L_tpnumber, rec.route_4 );
    20 end if;
    21 if rec.route_5 is not null then
    22 insert into t_quotes values( L_tpnumber, rec.route_5 );
    23 end if;
    24 end loop;
    25 end;
    26 /
    PL/SQL procedure successfully completed.
    SQL> select tpnumber, routes from t_quotes;
    TPNUMBER ROUTE
    1001 1
    1001 56W
    1001 18
    1002 2
    1002 16
    1002 186
    1002 28
    7 rows selected.

  • How do I divide a list in one cell into multiple rows?

    I have copied lists of data from a website - some lists pasted as I want them (in individual rows), but others pasted the list in one row.  Is there an easy way to split a list in a single cell into multiple cells so ultimately I can sort all the rows?  I've tried "split the selected cells into rows" in the inspector, but it's not working... seems like it's creating another column instead (?).  Any help would be amazing.

    K,
    I find that Pages has the friendliest Find and Replace dialog, so when I need to swap around the delimiters I go straight to Pages and do the fixes there. Replace whatever is there between columns in the original content with Tab characters and replace whatever is there now for delimiting the rows with the Return character. Since it's sometimes difficult to tell what has been used, just copy it from the content and Paste into the Find field. Choose the Tab or Return character from the Replace drop down menu.
    When you have it all fixed up, then paste into Numbers.
    Jerry

  • Convert one record row into multiple rows

    Hi,
       I have small requirement.I have selected one data base record into an internal table.Now internal table has 1 record i.e 1 row(ex: 10 columns). Now i will convert this single row record into multiple  records i.e 10 rows( 10 columns wil; be converted into 10 rows). How i will convert this. Please give me any idea on this.
    Regards
    Geetha

    Hi Geetha,
    Search SCN using keyword,  " convert Rows into columns" or vice versa,,,
    U will get more answers & solutions,
    Look at Some of the Previous threads....
    Re: How to create a structure of itab as rows as colums and columns rows dy
    Re: Transpose rows and columns
    CONVERT ROWS INTO COLUMNS IN INTERNAL TABLE
    Convert Internal table Rows into columns of another internal table
    how to convert columns of an internal table to rows of another internal tab.
    Convert Columns into Rows (internal tables) - Urgent Help Pleasse..
    converting columns to rows
    Thanks & regards,
    Dileep .C

  • XML into multiple rows

    I have an XML file to inset into multiple tables.
    My file is like
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <DCDS>
    <CDS>
         <COD></COD>
         <COD_INT></COD_INT>
         <ULTIMA_MODIFICA></ULTIMA_MODIFICA>
         <TIP></TIP>
         <DEN></DEN>
         <CLS>
              <ID></ID>
              <DEN></DEN>
         </CLS>
         <FAC></FAC>
         <OBT>
         <![CDATA[
         ]]>
         </OBT>
         <PRF>
         <![CDATA[
         ]]>
         </PRF>
         <OCC>
         <![CDATA[
         ]]>
         </OCC>
         <ACC>
         <![CDATA[
         ]]>
         </ACC>
         <CUR>
              <ID></ID>
              <DEN></DEN>
                   <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT></SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT></SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>               </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>               </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
              <DESCAMBITO></DESCAMBITO>
    <SETT></SETT>     <CF></CF>
              <CFMIN></CFMIN>
              <CFMAX></CFMAX>
              <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
         <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
              <CF></CF>
              <CFMIN> </CFMIN>
              <CFMAX> </CFMAX>
              <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
              <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
                   <CF></CF>
                   <CFMIN> </CFMIN>
                   <CFMAX> </CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
              <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
                   <CF></CF>
                   <CFMIN> </CFMIN>
                   <CFMAX> </CFMAX>
                   <TP></TP>
              </GRP>
                   <GRP>
                   <ID></ID>
                        <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
                   <CF></CF>
                   <CFMIN> </CFMIN>
                   <CFMAX> </CFMAX>
                   <TP></TP>
                   </GRP>
         </CUR>
    </CDS>
    </DCDS>
    In some cases, like <GRP> tag, I have to insert multiple rows in a table. I found the valueOf, but it extracts only the first value contained.
    payment.amount := xpath.valueOf(curNode,'.');
    Some tips?

    I have an XML file to inset into multiple tables.
    My file is like
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <DCDS>
    <CDS>
         <COD></COD>
         <COD_INT></COD_INT>
         <ULTIMA_MODIFICA></ULTIMA_MODIFICA>
         <TIP></TIP>
         <DEN></DEN>
         <CLS>
              <ID></ID>
              <DEN></DEN>
         </CLS>
         <FAC></FAC>
         <OBT>
         <![CDATA[
         ]]>
         </OBT>
         <PRF>
         <![CDATA[
         ]]>
         </PRF>
         <OCC>
         <![CDATA[
         ]]>
         </OCC>
         <ACC>
         <![CDATA[
         ]]>
         </ACC>
         <CUR>
              <ID></ID>
              <DEN></DEN>
                   <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT></SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT></SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>               </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>               </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
                   <DESCAMBITO></DESCAMBITO>
                   <SETT>
                   </SETT>
                   <CF></CF>
                   <CFMIN></CFMIN>
                   <CFMAX></CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
              <DESCAMBITO></DESCAMBITO>
    <SETT></SETT>     <CF></CF>
              <CFMIN></CFMIN>
              <CFMAX></CFMAX>
              <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
         <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
              <CF></CF>
              <CFMIN> </CFMIN>
              <CFMAX> </CFMAX>
              <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
              <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
                   <CF></CF>
                   <CFMIN> </CFMIN>
                   <CFMAX> </CFMAX>
                   <TP></TP>
              </GRP>
              <GRP>
                   <ID></ID>
              <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
                   <CF></CF>
                   <CFMIN> </CFMIN>
                   <CFMAX> </CFMAX>
                   <TP></TP>
              </GRP>
                   <GRP>
                   <ID></ID>
                        <DESCAMBITO></DESCAMBITO>
              <SETT> </SETT>
                   <CF></CF>
                   <CFMIN> </CFMIN>
                   <CFMAX> </CFMAX>
                   <TP></TP>
                   </GRP>
         </CUR>
    </CDS>
    </DCDS>
    In some cases, like <GRP> tag, I have to insert multiple rows in a table. I found the valueOf, but it extracts only the first value contained.
    payment.amount := xpath.valueOf(curNode,'.');
    Some tips?

  • 1 row into multiple rows

    I have a table time_entries
    create table time_entries
    (employee_id integer,
    start_date date,
    end_date date,
    CONSTRAINT pk_time_entries PRIMARY KEY (employee_id, start_date))Suppose I have one row in this table (dates in yyyy-mm-dd format):
    employee_id, start_date, end_date
    1, 2012-08-27, 2012-09-02
    As you can see the difference between the dates is 7 days. I want to write a query so that each day has its own row, i.e. I want to write a query which translates the above 1 row into 7 rows. This is the result set I want:
    employee_id, start_date, end_date
    1, 2012-08-27, 2012-08-27
    1, 2012-08-28, 2012-08-28
    1, 2012-08-29, 2012-08-29
    1, 2012-08-30, 2012-08-30
    1, 2012-08-31, 2012-08-31
    1, 2012-09-01, 2012-09-01
    1, 2012-09-02, 2012-09-02
    Is it possible to do it in one select statement?
    Edited by: srhcan on Aug 17, 2012 4:26 PM
    Edited by: srhcan on Aug 17, 2012 4:26 PM

    WITH t
         AS (SELECT 1 id,
                    TO_DATE ('2012-08-27', 'yyyy-mm-dd') start_date,
                    TO_DATE ('2012-09-02', 'yyyy-mm-dd') end_date
               FROM DUAL
             UNION ALL
             SELECT 2 id,
                    TO_DATE ('2012-10-27', 'yyyy-mm-dd') start_date,
                    TO_DATE ('2012-11-02', 'yyyy-mm-dd') end_date
               FROM DUAL)
    SELECT id, start_date, end_date
      FROM t
    MODEL
       PARTITION BY (id)
       DIMENSION BY (0 d)
       MEASURES (start_date, end_date, end_date stop)
       RULES
          ITERATE (10000) UNTIL start_date[ITERATION_NUMBER] = stop[0]
          (start_date [ITERATION_NUMBER] = start_date[0] + ITERATION_NUMBER,
          end_date [ITERATION_NUMBER] = start_date[0] + ITERATION_NUMBER)
    ID     START_DATE     END_DATE
    1     8/27/2012     8/27/2012
    1     8/28/2012     8/28/2012
    1     8/29/2012     8/29/2012
    1     8/30/2012     8/30/2012
    1     8/31/2012     8/31/2012
    1     9/1/2012     9/1/2012
    1     9/2/2012     9/2/2012
    2     10/27/2012     10/27/2012
    2     10/28/2012     10/28/2012
    2     10/29/2012     10/29/2012
    2     10/30/2012     10/30/2012
    2     10/31/2012     10/31/2012
    2     11/1/2012     11/1/2012
    2     11/2/2012     11/2/2012

  • How to convert columns of record into multiple rows

    Hi,
    I have the following data:
    Col1 Col2 Col3
    Dat1 Dat2 Dat3
    I would like to convert the above data into:
    Col1
    Dat1
    Dat2
    Dat3
    How can I achieve this beside using UNION?
    Appreciate advise urgently.
    Thanks and Regards,
    Shiau Chin

    Sorry, I misread your reqs. Is this what you are looking for:
    with t as (
               select 'Row1Dat1' col1,'Row1Dat2' col2,'Row1Dat3' col3,'Row1Dat4' col4 from dual union all
               select 'Row2Dat1' col1,'Row2Dat2' col2,'Row2Dat3' col3,'Row2Dat4' col4 from dual
    select  col4 col1,
            case lvl
              when 1 then col1
              when 2 then col2
              when 3 then col3
              else col4
            end col2
      from  t,
            (select level lvl from dual connect by level <= 3)
    COL1     COL2
    Row1Dat4 Row1Dat1
    Row2Dat4 Row2Dat1
    Row1Dat4 Row1Dat2
    Row2Dat4 Row2Dat2
    Row1Dat4 Row1Dat3
    Row2Dat4 Row2Dat3
    6 rows selected.
    SQL> SY.

  • Convert 1 row into multiple rows

    Guys - I have a table with 6 columns and it looks like this:
    1 2 3 4 5 6
    1 XX Y A Z ABC
    2 XX P AB CN CAB
    Now I want my output to be:
    1 2 3 4 5 6
    1 XX Y AAA AAB ABC
    2 XX Y AAC AAD ABC
    3 XX Y AAE AAF ABC......
    26 XX Y AAY AAZ ABC
    27 XX P ABA ABB CAB
    28 XX P ABC ABD CAB
    9999 XX P CNY CNZ CAB
    I am trying to do this in SQL , but without much luck. I can always do it with pl-sql but I want to keep that as my last option.
    Please, let me know if I need to explain this further...
    Thanks..

    1. Its not that I cannot do with pl/sql, but would like to try this with pure sql than pl / sql, thats what I meant
    2. for length( col4 and col5 ), its actually length(col4) =3 and length(col5) = 3, sorry if you miss understood it
    3. You are making up your data for all the possible combinations you might have i the future, thats why you are adding 'A' till 'Z' to each and every row...
    so for example if a row has
    col1 col4 col5 col6
    1 ZZX ZZZ john
    Now I need to make this row as:
    col1 col4 col5 col6
    1 ZZX ZZY john
    2 ZZZ ZZZ john
    So in the future if john is replaced by jack...then all I have to do it update these 2 rows col6 to 'jack' instead of 'john'.
    Now the col1 which is the primary key for my new table actually goes into another table as ID field (in my fact as a dimension key)....so I dont have to update both the tables rather I can live with just updating 1 table...
    Let me know if you need further explanation...

  • Inserting Selected Checkboxes into multiple rows

    Problem Statement
    Form Contains -
    Project Name (Select List - Single)
    Checklist (Checkboxes - Dynamic LOV, Values from Table - Master Checklist)
    Now I have to Insert into ProjectChecklistTabel.
    I select Project from list, select multiple checkboxes and click submitt. Now, data should be inserted into table as -
    ProjectSelected Checkbox1Value
    ProjectSelected Checkbox2Value
    ProjectSelected Checkbox3Value
    Can anyone explain how can I do this.

    Sure,
    Use the following code in a page process on submit:
    DECLARE
       l_vc_arr2   htmldb_application_global.vc_arr2;
    BEGIN
       l_vc_arr2 := HTMLDB_UTIL.string_to_table (:p1_checkbox);
       FOR i IN 1 .. l_vc_arr2.COUNT
       LOOP
          INSERT INTO checkbox_table
                      (checkbox_value
               VALUES (l_vc_arr2 (i)
       END LOOP;
    END;Also, see numerous examples on that issue here:
    http://htmldb.oracle.com/pls/otn/f?p=31517:84
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

Maybe you are looking for

  • Read Portal User ID in BW report to filter records

    Hi, I need to filter my records in BW report based on the business partner who logs into Portal. (BW report is getting called thur IView in Portal) Is there any way i can fetch the Portal User id during the execution of BW report? so then i can filte

  • Table control : Need to change Single field as non editable

    Hi Experts,                 Plz help me out. In a table control there r 7 fields and only one field is editable. When i change the status of a record as delete in tat table control, only the deleted record (all fields)should become non-editable. Is i

  • Sound Disappeared from youtube / hyperlinks

    when using Windows 7 (32 bit Home Premium version) in Bootcamp, it appears that I don't get any sound from youtube (or other similar sites, usually from email links).  I can boot in MAC OSX and go to the same site and the web video will play with sou

  • SAP Backup using Unix commands / tools

    Hi, We want to include file system backup process as part of our backup strategy. To test the waters, we are planning to take a backup of the at filesystems level. Following are the filesystems in our production systems. We have a test server (hostna

  • AirPort Utility doesn't cancel the Time Cpause disk erase process

    Hello! Am I the only one, whos' AirPort Utility for Windows 5.6.1 doesn't cancel the previously started erase process? (See the picture) Pressing the "Cancel" buttin doesn't change anything. The windows blinks and nothing happens. here's the screensh