How to insert same record multiple times in a loop..

Dear All,
I need to insert a record multiple time how it can be accomplish...
eg:
ref no name dept
123     abc 1     
122 def 2
121 feg 1
120 hhh 2
while inserting into another table:
all dept no 1 with should inserted 3 times for each record above
final out put should be :
table abc
ref no name dept
123     abc 1
123     abc 1
123     abc 1     
122 def 2
121 feg 1
121 feg 1
121 feg 1
120 hhh 2
Thank You

user3029023 wrote:
Dear All,
I need to insert a record multiple time how it can be accomplish...
eg:
ref no name dept
123     abc 1     
122 def 2
121 feg 1
120 hhh 2
while inserting into another table:
all dept no 1 with should inserted 3 times for each record above
final out put should be :
table abc
ref no name dept
123     abc 1
123     abc 1
123     abc 1     
122 def 2
121 feg 1
121 feg 1
121 feg 1
120 hhh 2
Thank YouTry this .
SQL> ed
Wrote file afiedt.buf
  1  with t as
  2  (select '123' AS ref_no,'abc' AS name,'1' as Dept
  3  from dual
  4  union all
  5  select '122','def','2' from dual
  6  union all
  7  select '333','feg','1' from dual
  8  union all
  9  select '120','hhh','2' from dual
10  )
11  select ref_no,name,Dept from t,(select level x from dual connect by  level <4)
12* order by 1
SQL> /
REF NAM D
120 hhh 2
120 hhh 2
120 hhh 2
122 def 2
122 def 2
122 def 2
123 abc 1
123 abc 1
123 abc 1
333 feg 1
333 feg 1
333 feg 1
12 rows selected.And insert the same onto your desired table.
Hope this Helps..
Regards,
Achyut

Similar Messages

  • Insert same row multiple times

    Hi,
    I've this table TAB1:
    COD.........TYPE........DESCRIP
    1..............RED..............MY COLOR
    I'd like to insert into table TAB2 this record 10000 times
    How can I write my insert or procedure to insert this row multiple times?
    Thanks in advance!

    Hi,
    Assuming tab1.col is unique:
    INSERT INTO tab2 (col_a, col_b, col_c)
    SELECT            cod,   type,  descrip
    FROM    tab1
    START WITH  cod = 1
    CONNECT BY  cod = 1
           AND  LEVEL <= 10000;If tab1.cod is not unique, use whatever is unique in the START WITH and CONNECT BY clauses. You do not have to SELECT the unique key.
    This does not assume that tab1 contains only the row you want to copy.
    As shown, this only works for making multiple copies of a single row.
    The multi-row version isn't much more complicated.

  • Insert Single record multiple times in a same database table

    Hello Guys,
    I need your thoughts for below scenario...
    I have a data file with 14 colums, more than 10000 records and in below format
    Data File Format
    id name c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12
    Now my requirement is for each record in a data file I have to insert 12 records in my Interface table.
    Lets say if above file is a sample data file, I have to insert record in my Interface table lilke following
    Insert into Interface_table(a1,a2,a3) Values (id,name,c1)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c2)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c3)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c4)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c5)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c6)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c7)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c8)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c9)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c10)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c11)
    Insert into Interface_table(a1,a2,a3) Values (id,name,c12)
    After getting the data file, We have stored all the data in a Custom table. Now I need to Import these records into interface table (as mentioned earlier).
    Can any one suggest me what will be the best approach/practice to load the above data.
    any help on this is appreciated !!
    Thanks,
    Ab

    Hi,
    you mean like this?
    SQL> create table samp1(x number,y number);
    Table created.
    SQL> insert into samp1 select rownum,rownum from dual,(select level from dual connect by level<=12);
    12 rows created.
    SQL> select * from samp1;
             X          Y
             1          1
             2          2
             3          3
             4          4
             5          5
             6          6
             7          7
             8          8
             9          9
            10         10
            11         11
             X          Y
            12         12
    12 rows selected.

  • Select Query Fetching same records multiple time

    Hi ABAPers,
    I have an issue where the select query is fetching the same records more than one time for particular sale order.
    Kindly help to solve the issue.
    Thanks in advance..
    Here is the Select Query:-
    SELECT  VBAK~VKORG VBAK~VTWEG VBAK~VBELN VBAK~KUNNR
                   VBAK~ERDAT VBAK~LIFSK VBKD~INCO1 VBKD~INCO2
                   VBAP~MATNR VBAP~ARKTX VBAP~MATKL VBAK~BSTNK
                   VBAK~BSTDK VBAK~KNUMV VBAP~UEPOS VBAP~POSNR
                   VBAP~KWMENG VBAK~VDATU VBAP~VRKME VBAK~ERNAM VBAK~WAERK
      INTO CORRESPONDING FIELDS OF TABLE IT_PENDING FROM VBAK
      INNER JOIN VBAP ON VBAK~VBELN = VBAP~VBELN
      INNER JOIN VBKD ON VBAK~VBELN = VBKD~VBELN
      WHERE
      VBAK~VBELN IN SO_VBELN AND
      VBAK~ERDAT IN SO_ERDAT AND
      ( AUART EQ 'OR' OR AUART EQ 'ZEO' OR AUART EQ 'TA' OR AUART EQ 'LP' OR AUART EQ 'ZFOC' ) AND
      VKORG IN SO_VKORG AND
      VTWEG IN SO_VTWEG AND
      SPART IN SO_SPART AND
      KUNNR IN SO_KUNNR AND
      MATNR IN SO_MATNR AND
      MATKL IN SO_MATKL AND
      ABGRU EQ '' AND LIFSK <> '35'.
    Edited by: Suhas Saha on Jan 14, 2012 3:42 PM

    Hello Suhale,
    On retrospection, I found the query in my above response STILL HAS ONE ISSUE. When we are making a left outer join on vbkdposnr = vbapposnr we are only fetching vbkdinco1 and vbkdinco2 values where item level entries exist in VBKD which match with vbkdposnr = vbapposnr.
    Actually we should bring inco1 and inco2 from vbkd when a matching entry exists in vbkd where vbkdposnr = vbapposnr and if there is no entry matching vbkdposnr = vbapposnr, then we should fetch inc01 and inco2 from VBKD where posnr = '000000' (i.e., from header).
    This is how SAP behaves when you open an item in VA03 and look at inco1 and inco2. They come from the item if an entry corresponding to that item exists in VBKD otherwise they come from VBKD header record (where vbkd~posnr = '000000')
    We can't use VBKD in the joins and still be able to do the above. So we need to fetch inco1, inco2 from VBKD separately like below.
    FIELD-SYMBOLS: <fs_pending> LIKE LINE OF it_pending.
    SELECT vbak~vkorg vbak~vtweg vbak~vbeln vbak~kunnr
           vbak~erdat vbak~lifsk "vbkd~inco1 vbkd~inco2
           vbap~matnr vbap~arktx vbap~matkl vbak~bstnk
           vbak~bstdk vbak~knumv vbap~uepos vbap~posnr
           vbap~kwmeng vbak~vdatu vbap~vrkme vbak~ernam vbak~waerk
      INTO CORRESPONDING FIELDS OF TABLE it_pending
        FROM vbak INNER JOIN vbap
          ON vbak~vbeln = vbap~vbeln
            WHERE vbak~vbeln IN so_vbeln AND
                  vbak~erdat IN so_erdat AND
                ( vbak~auart EQ 'OR' OR vbak~auart EQ 'ZEO' OR
                  vbak~auart EQ 'TA' OR vbak~auart EQ 'LP' OR
                  vbak~auart EQ 'ZFOC' ) AND
                  vbak~vkorg IN so_vkorg AND
                  vbak~vtweg IN so_vtweg AND
                  vbak~spart IN so_spart AND
                  vbak~kunnr IN so_kunnr AND
                  vbap~matnr IN so_matnr AND
                  vbap~matkl IN so_matkl AND
                  vbap~abgru EQ '' AND
                  vbak~lifsk NE '35'.
      LOOP AT it_pending ASSIGNING <fs_pending>.
        SELECT SINGLE inco1 inco2
          FROM vbkd
            INTO (<fs_pending>-inco1,<fs_pending>-inco2)
              WHERE vbkd~vbeln = <fs_pending>-vbeln AND
                    vbkd~posnr = <fs_pending>-posnr.
        IF sy-subrc NE 0.
          SELECT SINGLE inco1 inco2
            FROM vbkd
              INTO (<fs_pending>-inco1, <fs_pending>-inco2)
                WHERE vbkd~vbeln = <fs_pending>-vbeln AND
                      vbkd~posnr = '000000'.
        ENDIF.
      ENDLOOP.
    Best regards,
    Vishnu Tallapragada.

  • TS3276 how do I get Mail to stop downloading the same email multiple times?

    My mail keeps downloading the same email multiple times.  I've had as many as 10 of the same emial.  How do I stop this?

    Me too - did you ever figure it out?
    You can't even delete from the server in mountain lion.... I did it from my old mac, but it didn't work. I keep having 11,000 new emails that can not even be deleted in blocks!!!
    Was it a gmail account? Mine is, and my other 2 are fine...

  • Address book has same entries multiple times how can I go back to original cesium

    Address book has same entries multiple times how can I go back to original cesium

    After a couple of days, I'm noticing that the repeat(ing) offenders have more than 10 episodes, and seem to keep repeating them every time I sync.
    They only show once in my phone and in the iTunes Podcasts, but through iTunes and looking at what's in my phone is when I see the repeats.
    Even after I've marked a podcast as played, and deleted it from within my phone, as well as telling iTunes to delete the played episodes, it still shows multiples of the played episodes.
    There doesn't seem to be any rhyme or reason to it either. They aren't the newest ones either.

  • How to show the region multiple times on the same page

    Hi,
    I have a PL/SQL Dynamic Content region which creates a report with custom layout using pl/sql web toolkit. The stored procedure takes the parameter and creates report. Can I display the same region multiple times by calling it from loop with different parameter each time ?
    Thank you,
    Asha

    Hello Asha,
    In your plsql you can do a loop, so you would only have one plsql region but in there that can generate different areas of your website.
    e.g. it can loop and generate different divs or tables.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/

  • How to automate saving the same image multiple times?

    Hello. I wish to save the same image multiple times in a folder... is there a way to automate this function? I also need the flexibility of determining the starting number in this image sequence. Thanks.

    Good day!
    I would recommend asking for help over at
    Photoshop Scripting
    And going into more detail about what you want to achieve (maybe post a screenshot, diagram, mock-up to illustrate it).
    Regards,
    Pfaffenbichler

  • How to Insert a record in a database table in debugging mode in production

    Hi,
    How to Insert a record in a database table in debugging mode in production ?
    Waiting for kind response.
    Best Regards,
    Padhy
    Moderator Message : Duplicate post locked.
    Moderator message : Warning. Don't create multiple threads for same question.
    Edited by: Vinod Kumar on May 12, 2011 11:02 AM
    Edited by: Vinod Kumar on May 12, 2011 11:04 AM

    Hi Senthil,
    Regards,
    Phani Raj Kallur
    Message was edited by: Phani Raj Kallur

  • Is it possible to copy the same database multiple times simultaneously?

    This is the setup of my environment.
    I have a 'master' database that contains the full schema plus some pre-populated data such as default settings. When database schema changes are made, they get made to the master database. When a new customer signs up for the service, I make a copy of this
    master database (using SMO) that will now be the database containing all of the customer's information. The database is rather large, and the copy operation can take a couple minutes.
    Everything works fine as expected, unless I try to provision two new customers at the same time. It appears that Azure only allows for one DB copy operation at a time. Is there a way to allow for copying the same database multiple times simultaneously?
    Thanks for you input. I understand that this is likely not the optimal setup, and that there is many better ways of doing this, but I am somewhat heavily invested in the current process and I would like to find out how to make it work if I can.

    BTW, you can do this programatically by using PowerShell (https://msdn.microsoft.com/en-us/library/ee210569.aspx), SqlPackage (http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/)
    or the SQL Server binaries for .NET (http://www.vijayt.com/Post/Deploying-a-data-tier-application-in-SQL-Azure-programatically)
    Hope this helps.
    Alex

  • Placing the same object multiple times

    Does anyone know how to place an object multiple times in either Illustrator or InDesign?  I have a small graphic that I would like to have repeated (probably hundreds of times) to create a background.  I could place it over and over (and over and over and over), but that would be way too labor intensive.
    Is there a way to put it in like it is a self-replicating background?
    Thanks,
    John

    A Symbol, by definition, is stored only once in the file. A Symbol Instance is just a reference. When an Instance is duplicated, only a reference is duplicated.
    Evidently Transform Effect--albeit "live"--does not do the same. It actually does create multiple duplicates of the original. The duplicates are "linked" to the original so that if the original changes, the effect is reapplied on-the-fly in response--but it is applied (and the copies made) all the same. Copies of a Symbol Instance, however, are in and of themselves nothing but position/scale references to the original. So Transform Effect is replicating just those references.
    I don't really find this surprising. Consider other so-called "live" effects. When you add multiple strokes and fills to a path, you are not just adding position/size references to the path; the added strokes and fills are, in fact, being created--regardless of the fact that they are recreated on-the-fly if you modify the path.
    Same way with Pattern fills. The pattern is actually stepped-and-repeated enough times to fill the clipping path to which it is applied. If you reshape or resize the clipping path, the Pattern Fill gets re-built on-the-fly. But it still gets built all the same.
    Apply a live Drop Shadow Effect. That raster image acutally gets created. Change the object to which it is applied, or change the parameters (like resolution) of the shadow, and the raster gets deleted and a new one gets created on-the-fly. But it still gets created, and exists in the file until and unless it is changed.
    I think of "Expanding" a live effect as nothing more than breaking the "link" between all the extra created stuff (which is there) and the object to which it was applied. I don't think of all that extra stuff as "not existing yet." It exists. It's been drawn. You're just not allowed to manipulate it directly, because it is "linked" to the original so that it will be deleted and re-created if you edit the original. Breaking the link (Expanding) doesn't take long, becaues all that stuff is already created; it's not just a string of concise commands waiting to be created. It's already there. But make an edit to the original and it does take a long time to re-draw, because all the extra stuff now has to be re-created.
    Do a Transform Effect on a Symbol Instance. Expand the result. You'll see that what you have is a group of Symbol Instances. And Symbol Instances are just references--commands to "put a copy of that here."
    Use a Symbol Instance in some other construct, like for example, a Pattern Fill. Expand the Pattern Fill and you'll not end up with a group of Symbol Instances; you'll end up with a bunch of actual copies of the artwork which the Symbol contains.
    Same with a Scatter Brush. Now, I can understand a Symbol not working with a Pattern Brush or Art Brush because of the enveloping that has to go on. But all a Scatter Brush does is position/scale/rotate copies. So I would expect a Symbol Instance used in a Scatter Brush to create Symbol Instances. But it doesn't. Try it. Draw a red circle. Make it a Symbol. Use the Symbol Instance to define a Scatter Brush. Draw a path and apply the Brush.  Now doubleClick the original Instance still on the page to put it in Isolation Mode. Change its fill to green. Exit Isolation Mode. The circles on the Brush Path do not update.  They are actual copies of artwork, not Symbol Instances. Who knows why? Perhaps it would break other features/behaviors of Scatter Brushes I never use (Wacom tilt?). Or maybe they could have made it work with Symbols, but just didn't. Didn't AI Brushes exist before Symbols? Illustrator's history is full of later features not being well integrated into the pre-existing feature set (ex: LivePaint and Brushes).
    JET

  • Provision same resource multiple times

    All,
    I have a scenario to provision same resource multiple times for the same user.
    How to make a resource to allow provisioning multiple times in OIM 11gR2. I am not seeing th option "allow multiple" in resource object in the design console.
    Please help.

    In OIM 11g R2 you can assign same resource multiple time.
    The account which gets assigned first time will be marked as primary and the rest others will be marked as "other"
    HTH

  • Avoid opening same Form Multiple times

    hi
    Can anyone help me , how to put restruction not to open the same form multiple times .
    regds/sanjay

    I'm not suggesting that the following is great idea but..
    You could start a timer and keep updating the row in the table with a timestamp and then have a job which checks if there are rows in the table that have timestamps older than the timer interval.
    I actually think that that is really bad idea.
    I think its more important to ask why this is a requirement? I currently write sytems for police officers and even they can grasp the concept that someone else might be updating the same data at the same time as them and can work multiple sessions. Its hard for them, and sometimes I think they may just be hitting their keyboards with a truncheon, but they do get it.

  • Openscript records multiple times

    Hi,
    It records the same step multiple times.  I'm using Openscript 12x with Siebel. 
    Thanks,
    Will

    Hum very difficult to tell you...
    Is that a load or a functional test script?
    Do you use the proper OpenScript script template?
    Have you properly configured Siebel to be able to record HI user actions?
    JB

  • HT1689 Billed for same app multiple times

    We were billed for the same app multiple times, how do I contact apple iTunes to get this fixed?

    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
    How to report an issue with Your iTunes Store purchase
    http://support.apple.com/kb/HT1933
    iTunes Purchase Problems: How to Report a Problem to iTunes Support
    http://tinyurl.com/7tscpa7
    iOS: Troubleshooting applications purchased from the App Store
    http://support.apple.com/kb/TS1702?viewlocale=en_US&locale=en_US
    How to Get a Refund from the App Store
    http://gizmodo.com/5886683/how-to-get-a-refund-from-the-app-store
    Getting Refunds for your iTunes Store Purchases
    http://www.labnol.org/software/itunes-app-store-refunds/13838/
    Canceling a Digital Subscription
    http://gadgetwise.blogs.nytimes.com/2011/10/14/qa-canceling-a-digital-subscripti on/
     Cheers, Tom

Maybe you are looking for