Insert values - with a trick! (multi-step sequences?)

I have a table with 4 columns which I need to populate with values. The values respect a repeating pattern which is different from one column to the next.
Column 1: has values starting with 1 and ending with 10, repeating 16200 times. That's easy to code, by creating a sequence and using it:
CREATE SEQUENCE "UNITEST"."SEQPLOCATION" MINVALUE 1 MAXVALUE 10 INCREMENT BY 1 START WITH 11 CACHE 9 NOORDER CYCLE ;
Column 2 is a bit trickier. First value is 1 and it's increased by 1 every time Column 1 values change back to 1, until Column 2 values reach 100, then it goes back to 1 and so on and so forth.
Column 3 adds to complexity. Starts with 1 and repeats that value until Column 2 values reset back to 1. When that happens, value for that row changes to 2 and so on until it reaches 27. Then it goes back to 1.
Column 4 starts as well with 1 as first value and keeps it until Column 3 value resets from 27 to 1. When that happens, column 4 value for that row becomes 2 and so on until it reaches 6.
In total, we have 10*100*27*6 = 162000 rows.
Structure is below:
C1 C2 C3 C4 ROWNUM
1 1 1 1 1
2 1 1 1 2
10 1 1 1 10
1 2 1 1 11
10 100 1 1 1000
1 1 2 1 1001
10 100 27 1 27000
1 1 1 2 27001
10 100 27 6 162000
Is there a way to automatically insert all these value respecting those constraints into the table? I do have the values in an XLS (very simple to add them there) but I'd like to free myself from imports and have everything in the DB.
Thank you in advance for the responses!

Interesting point.
I have re-checked the generated values and indeed they don't really work as designed (in case of the MODEL solution).
Here's an example code I used for testing (note I added column pid for sanity check and reversed column order, because that's how I need them displayed):
create table unitest
(pid number, pg number, pc number, ps number, pp number);
insert into unitest
(select pid, c4, c3, c2, c1 from dual
model
dimension by (1 n)
measures(1 pid, 1 c1, 1 c2, 1 c3, 1 c4)
rules (
pid[for n from 1 to 162000 increment 1]=cv(n),
c1[for n from 1 to 162000 increment 1]=mod(cv(n)-1,10)+1,
c2[n] order by n=case
when c2[cv(n)-1]=100 then 1
when c1[cv(n)]=1 and c1[cv(n)-1]!=1 then nvl(c2[cv(n)-1] + 1, 1)
else nvl(c2[cv(n)-1], 1)end,
c3[n] order by n=case when c3[cv(n)-1]=27 then 1
when c2[cv(n)]=1 and c2[cv(n)]!=1 then nvl(c3[cv(n)-1]+1,1)
else nvl(c3[cv(n)-1], 1)end,
c4[n] order by n=case when c4[cv(n)-1]=6 then 1
when c3[cv(n)-1]=27 then nvl(c4[cv(n)-1]+1, 1)else nvl(c4[cv(n)-1], 1)end));Checking transition from 100 to 1:
select * from unitest where pid between 990 and 1010;Results:
990     1     1     99     10
991     1     1     100     1
992     1     1     1     2
993     1     1     1     3
994     1     1     1     4
995     1     1     1     5
996     1     1     1     6
997     1     1     1     7
998     1     1     1     8
999     1     1     1     9
1000     1     1     1     10
1001     1     1     2     1
1002     1     1     2     2
1003     1     1     2     3
1004     1     1     2     4
1005     1     1     2     5
1006     1     1     2     6
1007     1     1     2     7
1008     1     1     2     8
1009     1     1     2     9
1010     1     1     2     10Now... for pid 990 to 1010 I see fourth column values as being 1,1,1...1 and instead they should have been 100, 100....100 - because 100 still needs to be there for all values in the 5th column.
My table should contain these values for pid between 990 and 1010:
990     1     1     99     10
991     1     1     100     1
992     1     1     100     2
993     1     1     100     3
994     1     1     100     4
995     1     1     100     5
996     1     1     100     6
997     1     1     100     7
998     1     1     100     8
999     1     1     100     9
1000     1     1     100     10
1001     1     2     1     1
1002     1     2     1     2
1003     1     2     1     3
1004     1     2     1     4
1005     1     2     1     5
1006     1     2     1     6
1007     1     2     1     7
1008     1     2     1     8
1009     1     2     1     9I hope this clarifies my need. I am looking at the model code you provided and trying to make some changes to address my need but I'm a newbie and it might take a while :)

Similar Messages

  • Insert value with quotes into the table

    Hi,
    How can I insert a value along with quotes into a table column of type varchar.
    Meaning..I want to insert the value 'TEST' including the single quotes.
    Regards,
    Murali Mohan

    It only a matter of using the correct number of quotes. to insert 'TEST' you use 3 quotes on each end
    example: '''TEST'''
    Hi,
    How can I insert a value along with quotes into a table column of type varchar.
    Meaning..I want to insert the value 'TEST' including the single quotes.
    Regards,
    Murali Mohan

  • How can i insert values with single quote (')

    How can i insert a values like ABC's ?
    Edited by: LuKKa on Oct 6, 2010 12:48 PM

    LuKKa wrote:
    I want to insert like this :-
    INSERT INTO myTab values ('This is belong's to ABC's ');
    Then how can i do ?In a old style you can do this
    insert into mytab valeus('This is belong''s to ABC''s');

  • Cannot insert value with : into BLOB field

    I am using Oracle 10g Express Edition.
    Attempting to run this insert from the SQL Commands page:
    INSERT INTO table1 (col1, col2)
    VALUES ('one', '\"2.001:2372.002:002.005:Y2.018:G')
    Table1 info:
    col1 = VARCHAR2(25)
    col2 = BLOB
    After I click Run an Enter Tab Variables appears?
    Is it possible to insert the value straight into col2 without entering bind variables?

    wrong forum

  • Work flow? How to link multi-cam sequences for DVD output?

    Pr cs4 (very new)
    Still taking baby steps each day... please take my hand and help me!
    Final output will be 2 DVD's (each DL) each about 2 hrs. Content are chamber music student groups in two recitals.
    I have assets from two camera angles. I have successfully practiced on one of the groups performance (10 min.) following the steps illustrated in a multi-cam tutorial.  http://www.adobe.com/designcenter/video_workshop/?id=vid0234
    This leaves me with a great multi-cam sequence for that group located in the Project Panel, exactly what I want.
    Now, I want to know what is the best method (workflow?) to ultimately produce a DVD containing about 10 of these type performances (one after the other) with chapter markings for each group, titles etc.?
    I have yet to use Encore and I'm guessing that is where I'll send the finished edit for DVD production, though I don't know at what step I jump there?
    Do I try to create one very long multi cam sequence of all the content, then send to Encore? Or can I create seperate multi-cam sequences (each performance) then link them together, adding transitions and make the DVD? This would be my preference to keep things more manageable, especially with audio synching.
    With my practice multi-cam sequence on the timeline, I tried to drag the same sequence from the Project Panel to the end of the timeline to simulate how this would work, but it does not add to the timeline as a clip would.
    This is probably childs play for you pro's, but we were all baby's at one time...I just happen to still be one!
    Thanks for your patience and advice,
    Kenny

    Yes I did...now toss me a cookie please.
    I am trying to quickly get up to speed in Pr CS4 to get this project completed. In the process, I'm trying to learn and understand the interface and correct terminology so as to make my questions intelligible to a community that posses vastly greater understanding than myself.
    Is there anyone who can help with my main question at hand? Namely, how to go about creating a full length sequence (in the timeline) made via the nesting of synchronized multi-camera clips within a new "multi-cam sequence"?
    As I said, I have completed a small test sequence in this fashion, nesting clips in a new sequence then using multi-cam monitor to record cuts. Now I need to add about 10 more of these together in a completed sequence to then send to DVD production.
    Is this intelligible?
    Thanks, Kenny 
          __0
       _ \<,_
    Date: Wed, 4 Nov 2009 09:11:06 -0700
    From: [email protected]
    To: [email protected]
    Subject: Work flow? How to link multi-cam sequences for DVD output?
    please take my hand and help me!
    Well, at least you had the gumption to admit that up front.
    >

  • Is there a step sequencer for drum patterns in logic express?

    I was wondering is there a step sequencer for doing drum beats in logic express? It would be much easier if there were, that way I wouldn't have to record it and then try and fix my beat in the matrix editor. I believe that there is a step sequencer included with ultrabeat but I know that that is only with logic pro.

    The latest issue of Sound on Sound covers how to do this with the Hyper Editor.
    http://www.soundonsound.com/sos/mar06/articles/logictech.htm
    That link will only work if you're a subscriber, until SOS declassifies it for everyone in six months.
    The GM method will work for something that's GM compatible, and you can use this method to create your own custom version for any other drum instrument you want. It's pretty sweet. The gist of it is you create a mapped instrument in the environment, cable it to your audio instrument of interest, rename the notes to whatever drum/percussion sound they match (if needed), create a MIDI region with one note each, then make a hyper set out of it.
    It seems like a lot of steps, but it's pretty simple once you've done it once, and you end up with a very flexible step sequencer-like editor. You can repeat these steps to make editors that are customized for any instrument plugin you like.

  • How to create a sequence number to insert values to database

    I am working on the application for the client to insert their vendor informaton to our database. We have a refvendor table and vendorid is primary key. I was asked for the vendorid to be a sequential number. I am not sure if the DBA set up the vendor id to be a sequential number by creating sequence or is this something i can do myself. if so can you help me how i can create and make the vendor id a sequentiial number. Thank you
    Tablename is Refvendor
    vendorId, vendorname, dbestaus

    user452051 wrote:
    thank you for the reply. I am still learning about sequence. so the value from seq.netval will be inserted to the vendor id field. my first number will be 00001,00002,00003,00004,.... How can I do for the sequence to start with 00001If you create a sequence as shown, it will start with 1
    ,..... and my other question if I delete sequence 00002 will the number be re-arranged?no
    There will be gaps in the numbers.

  • Help with inserting values -- ORA-00984 error

    Hello!
    This time we have a problem with inserting values and we really can't find what's wrong!
    The table was created as such
    CREATE TABLE PASSAGER
    (NO_PERSONNE INTEGER,
    NO_PASSAGER INTEGER NOT NULL,
    NO_PASSEPORT INTEGER NOT NULL,
    NATIONALITE VARCHAR2(30) NOT NULL,
    LIEU_EMISSION VARCHAR2(30) NOT NULL,
    DATE_EMISSION DATE NOT NULL,
    NO_TEL INTEGER,
    NO_CC INTEGER,
    NO_VENTE INTEGER NOT NULL,
    CONSTRAINT PK_PASSAGER PRIMARY KEY (NO_PERSONNE),
    CONSTRAINT FK_PASSAGER_PERSONNE FOREIGN KEY (NO_PERSONNE) REFERENCES PERSONNE (NO_PERSONNE),
    CONSTRAINT FK_PASSAGER_VENTE FOREIGN KEY (NO_VENTE) REFERENCES VENTE (NO_VENTE));
    We created a sequence..
    CREATE SEQUENCE NOPASS_SEQ
    START WITH 1
    INCREMENT BY 1
    NOCACHE
    NOCYCLE;
    for inserting the values, we did...
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, WT456789,'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);
    but it won't work, it's our last table and all the other worked perfectly!
    Thanks a ton!

    In your table creation, you got third column as
    NO_PASSEPORT INTEGER NOT NULL,
    where as you are passing varchar values (see bold)
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, WT456789,+'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);
    Should be like this I suppose
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, *456789*,'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);

  • Issues with creating multi camera sequences

    I'm using Premiere Pro CC 2014.2 and I’ve just started experimenting with multi camera sequences and have two problems, one I can work around, the other I can’t.
    First, if I take a series of video clips, add a marker to each clip to identify the sync point, name the marker, and subsequently create a multi camera source sequence, the option to use the marker as the sync point is disabled.  If I leave the markers blank and don’t name them, it works.  Is this a bug or intended behaviour of the application?
    Second, and more problematic for me; if I create a multi camera source sequence using two or more video clips, all of which have a stereo soundtrack except for one clip, and that single clip has a 5.1 soundtrack, I cannot seem to force the sequence to use the audio from only one of the clips with a stereo soundtrack.  Basically I want the audio to always originate from the first clip (camera 1) during the clip selection process.  I’ve selected the clips in the right order and ensured all other settings are correct, but the 5.1 clip always take precedence.
    If all the video clips contain the same format of audio (in my case all stereo or all 5.1), I can select which clip becomes the default no problem, it’s only when a 5.1 clip is included in the source clips when all the others are stereo.  Is there a way to select the 5.1 clip and make it the (camera 1) audio source?
    Thanks in advance,
    Steve

    I'm guessing the marker thing is by design.
    For the audio, once the sequence is created, just Mute all the stereo tracks.

  • How can I automate the multi-step process of looking up a caller's contact details when a telephone call comes in with caller ID?

    How can I automate the multi-step process of looking up a caller's contact details when a telephone call comes in with caller ID. I want to be able to see more than just the first & last name when a client calls me. I would like the caller ID to pull up the same information that shows up when you search for and find a contact name and then click on the right arrow.
    My workaround is to force/enter both the last name and the address in the last name field since then the address will show up.
    The only computerized way to look up this additional information is to put the client on hold, memorize the first and last name and correctly enter it in the search field of the contact database and hopefully find it before the client gets tired of waiting.
    Note that I go to about 48 small jobs per week. So far I have about 9,000 contacts. It's easy to make a mistake and have the client wondering what I'm doing and what's taking so long.
    The second workaround is to use paper and pencil and ask the client for name, address, cross street and phone number again, repeating what I did some time previously.
    Please help meautomate this process.

    You don't have to put anyone on hold. When the call comes in, tap the Home button, then tap contacts, go to the contact. Tap Home button when finished, tap the top banner to return to the call screen.

  • Massive problems with nested multi-cam sequences

    Hey all,
    I'm absolutely pulling my hair out over some issues I'm having and hope somebody out there might have an answer.  I'm creating a short interview project, including interviews of two people individually, with two separate cameras and external sound capture.  My goal is to cut between their separate answers to each question.  For each interview I created a multi-cam sequence within its own timeline.  Then, in my master sequence, I used the source monitor to pull out the specific clips from each interview sequence which I wanted to include, and assembled them into the master timeline.
    I'm having two difficulties.  First, for whatever reason, I'm experiencing audio glitching when the cuts between sequence clips occur.  The glitch is like an audio "scramble," lasts about a half second, plenty of time to be distracting and detract from the whole of the project.  There are no such audio glitches present when viewing the interview sequences specifically.  I had applied effects to the audio tracks both within the interview sequences and the master sequence.  I've since disabled every effect but the problem persists, and it is still present upon rendering the master timeline.  I have absolutely no idea what to do about this.
    The second issue is more general.  I've got my media cache on an internal SSD, and I'm pulling my media from an internal HDD, with Premiere Installed on a different SSD with my operating system.  The two interview sequences play back wonderfully, no delays whatsoever.  The master timeline, however, with all the clips extracted from the interview sequences, plays slow as molasses.  It takes 10-15 seconds for the play head to even start moving once I click 'play', which has made this entire process excruciatingly difficult.  Is this a known issue?  Why would my performance be so completely degraded working with nested sequences?  Isn't everything referencing the exact same files?
    Ugh, long night working on this.  Thank you for any help.

    Well, I've come up with a terrible, but comical solution for the second issue which doesn't involve reworking anything.  It turns out that, upon launching premiere, I can play the master sequence with nested multi-cam sequences a grand total of ONCE with minimal delay.  If I stop the play through, then it will take 3-4 minutes to get the sequence playing again.  Of course, the Premiere decides to hang when I try to close it after playing this master timeline, so I'm finding that I can inch my way through this project by (1) launching premiere, (2) playing the master sequence, (3) make the edits I need, (4) forcibly crash Premiere, and (5) relaunch Premiere and repeat.  It's a terrible way to work, but the project is so close to completion that I'm willing to suffer through it.
    As to issue 1, I've taken each offending clip, extending the audio track one or two frames in the beginning of each clip, and then use those frames to ramp the volume up from silent to 0db.  This seems to avoid the brief moment of distortion at the beginning.  Notably I did try your suggestion by going back to the original, source audio, but I was still getting the same issue.  My work-around is the only solution I've been able to come up with.

  • Inserting values into multiple tables in one jsf page with single commit op

    hi all,
    i have two tables ,
    one is parent table and other is child record.
    record details:
    table1:(parent table)
    emplid (primary key)
    empl_name
    table 2:(child table)
    empl id ( Foreign key)
    empl_name ( Foreign key)
    contact_no (primary key)
    my senario is , i need insert values into both parent and child table in one save option.
    and both the tables will be in one jsf page.
    is this possible to do?
    thanks all,
    regards,
    M vijayalakshmi

    hi,
    i feel my question is not clear.
    let me explain my question clearly.
    1. i have two records
    *1. emp_names*
    attributes of this table is 1.emplid
    2.emp_name.
    emplid is a primary key.
    2. emp_contact
    attributes of this table is 1.emplid
    2. contact_no
    In this table emplid is forigen key from emp_name table
    contact_no is primary key.
    and my senerio is,
    for one emplid there are many contact no.
    in database diagram i have created these two entities. and from that i have generated two views objects.
    now in jsf page ,
    i shd have all fields from both the records.
    wn ever i click on add button , i shd be able to insert one complete row of data to both the tables.
    means,
    emplid
    empl_name
    contact_no.
    and if i click on commit button data shd be insert in both the tables.
    so how to achive this?
    am very beginner to the jdeveloper tool.
    regards,
    m vijayalakshmi.

  • Exporting Page fails with ORA-1401 inserted value too large for column

    Hi Everyone,
    I have a client what is getting the following error when
    attempting to export a page using pageexp.cmd. A simple page
    works for them but there main page does not. Here is the error:
    Extracting Portal Page Data for Export...
    begin
    ERROR at line 1:
    ORA-01401: inserted value too large for column
    ORA-06512: at "PORTAL30.WWUTL_POB_EXPORT", line 660
    ORA-06512: at "PORTAL30.WWUTL_POB_EXPORT", line 889
    ORA-06512: at line 5
    Has anyone seen this before?
    Is there any way we can narrow down why this occurs?
    There is no logging on this export option and the stored
    procedures used are wrapped.
    Any ideas?
    Thanks
    Oracle Portal Version: 3.0.9.8.0

    we had this problem.
    We talked to some oracle person who said some portlets on a page had trouble exporting.
    Sure enough after we deleted all the portlets (one at a time to determine which one was giving us the problem. Turned out none of ours worked) the page exported and imported just fine.
    Hopefully this is being worked on...

  • Inserting values using merge

    Hi everyone,
    I need help with inserting values using merge.
    * I need to check all the units in a parent category. For example, NF_ARTICLECATEGORYID = 7462 is a parent category.
    * Im going to compare all the units in the parent category(7642) to the units in a subcategory (8053).
    * If the units in parent category(7642) is not present in the subcategory(8053) then the units will be inserted in the same table.
    table structure:
    Table name : ARTICLECATEGORYACCESS
    Fields: IP_ARTICLECATEGORYACCESSID
    NF_ARTICLECATEGORYID
    NF_UNITID
    NF_USERID
    N_VIEW
    N_EDIT
    Sample data:
    CREATE TABLE articlecategoryaccess (
    IP_ARTICLECATEGORYACCESSID NUMBER(5),
    NF_ARTICLECATEGORYID NUMBER (10),
    NF_UNITID NUMBER (10),
    NF_USERID NUMBER (10)
    N_VIEW INT,
    N_EDIT INT);
    INSERT INTO articlecategoryaccess VALUES (255583, 7642, 29727, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (243977,7642,29728, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (240770,7642,29843, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (243413,7642,29844, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (274828,7642,44849, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (274828,8053,44849, NULL, 1 ,1);
    Units ID 29727, 29728, 29843, 29844, 44849 has access to parent category 7642.
    The units id 29727, 29728, 29843, 29844 dont have access to subcategory 8053.
    29727, 29728, 29843, 29844 should be inserted in the same table and will have an access to 8053.
    After they are inserted, it should look like this
    IP_ARTICLECATEGORYACCESSID     NF_ARTICLECATEGORYID     NF_UNITID NF_USERID N_VIEW N_EDIT
    255583     7642     29727 null 1 1
    243977     7642     29728 null 1 1
    240770     7642     29843 null 1 1
    243413     7642     29844 null 1 1
    274828     7642     44849 null 1 1
    new value     8053     44849 null 1 1
    new value     8053     29843 null 1 1
    new value     8053     29844 null 1 1
    new value     8053     29728 null 1 1
    new value     8053     29727 null 1 1
    NOTE: IP_ARTICLECATEGORYACCESSID is a sequence and it should be unique
    DECLARE
    BEGIN
    MERGE INTO articlecategoryaccess b
    USING (SELECT *
    FROM articlecategoryaccess c
    WHERE nf_articlecategoryid = 7642
    MINUS
    SELECT *
    FROM articlecategoryaccess c
    WHERE nf_articlecategoryid = 8053) e
    ON (1 = 2)
    WHEN NOT MATCHED THEN
    INSERT (b.ip_articlecategoryaccessid, b.nf_articlecategoryid, b.nf_unitid, b.NF_USERID, b.N_VIEW, b.N_EDIT)
    VALUES (articlecategoryaccessid_seq.nextval, 8053, e.nf_unitid, null, 1, 1);
    END;
    i got an error after running the script:
    *Cause:    An UPDATE or INSERT statement attempted to insert a duplicate key.
    For Trusted Oracle configured in DBMS MAC mode, you may see
    this message if a duplicate entry exists at a different level.
    *Action:   Either remove the unique restriction or do not insert the key.
    why would it be duplicated? its a sequence and its unique.. I dont know, maybe there is something wrong my script..
    Any help is appreciated..
    Ed

    Ed,
    1. What is the current value of the Sequence? Does the current value of sequence exist in the table? If yes, then increment the sequence to a value that is not present in the Table.
    2. Do you have any unique constraint on any of the columns that you are inserting?
    I have to ask you again, Why are you insisting on Merge statement when a simple Insert can do the job for you? Don't you feel that the below specified Merge statement is making things look more Complicated than they actually are, do you?
    Think on it and then proceed. I hope these pointers help you to resolve the issue.
    Regards,
    P.

  • ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence

    Hi ,
    I executed the below query in database version 11.2.0.3.0, it throws the error like "ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence"
    with PAYMENT_XML as (
          select XMLTYPE(
            '<Document>
            <pain.002.001.02>
                <GrpHdr>
                      <MsgId>CITIBANK/20091204-PSR/4274</MsgId>
                      <CreDtTm>2009-12-04T09:36:00</CreDtTm>
               </GrpHdr>
                <OrgnlGrpInfAndSts>
                <OrgnlMsgId>10002</OrgnlMsgId>
                <OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
                <OrgnlNbOfTxs>20</OrgnlNbOfTxs>
                <OrgnlCtrlSum>7000</OrgnlCtrlSum>
                <GrpSts>PART</GrpSts>
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                </StsRsnInf>
              </OrgnlGrpInfAndSts>
              <OrgnlGrpInfAndSts>
                <OrgnlMsgId>10001</OrgnlMsgId>
                <OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
                <OrgnlNbOfTxs>202</OrgnlNbOfTxs>
                <OrgnlCtrlSum>9000</OrgnlCtrlSum>
                <GrpSts>PART</GrpSts>
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                  <AddtlStsRsnInf>Formated</AddtlStsRsnInf>
                </StsRsnInf>
              </OrgnlGrpInfAndSts>
          </pain.002.001.02>
      </Document>') as OBJECT_VALUE1
       from dual
      select R.*
      from PAYMENT_XML,
           XMLTABLE(
           'for $COMP in $COMPANY/Document/pain.002.001.02
              for $DEPT at $DEPTIDX in $COMP/OrgnlGrpInfAndSts
               return <RESULT>
                        <NAME>{fn:data($COMP/GrpHdr/MsgId)}</NAME>
                          $DEPT/OrgnlMsgId,
                          $DEPT/OrgnlNbOfTxs,
                          $DEPT/OrgnlCtrlSum,
                          $DEPT/GrpSts,
                          $DEPT/StsRsnInf/AddtlStsRsnInf
                      </RESULT>'
           passing OBJECT_VALUE1 as "COMPANY"
           columns
             NAME            VARCHAR(10)  path 'NAME',
             OrgnlMsgId      VARCHAR2(24) path 'OrgnlMsgId',
             ORGNLNBOFTXS    VARCHAR2(24) path 'OrgnlNbOfTxs',
             ORGNLCTRLSUM    NUMBER       path 'OrgnlCtrlSum',
             GRPSTS          VARCHAR2(24) path 'GrpSts',
             ADDTLSTSRSNINF  VARCHAR2(40) path 'AddtlStsRsnInf'
         ) r
    Errors comes this part :
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                  <AddtlStsRsnInf>Formated</AddtlStsRsnInf>
                </StsRsnInf>
    if i put the single statement for this xml element <AddtlStsRsnInf> it works fine if more than one element comes it raised the error.
    i want the output like the below format : want to merge the element value with (, comma)  delimiter with single coloumn value
    NAME
    ORGNLMSGID
    ORGNLNBOFTXS
    ORGNLCTRLSUM
    GRPSTS
    ADDTLSTSRSNINF
    CITIBANK/2
    10002
    20
    7,000
    PART
    ACK - FILE PARTIALLY SUCCESSFUL
    CITIBANK/2
    10001
    202
    9,000
    PART
    ACK - FILE PARTIALLY SUCCESSFUL, Formated
    Thanks is advance for reply
    Thanks,
    Chidam

    Try with XQuery string-join() function :
    ADDTLSTSRSNINF  VARCHAR2(40) path 'string-join(AddtlStsRsnInf, ", ")'

Maybe you are looking for