validation for each 1,000 records to be inserted in the select statement

Hi, I have the following INSERTION in the SELECT statement.
The SELECT statement (who joined) data fo about 6 crores. I need to insert this data into another table.

Please suggest me the best way to do it.
I use the INSERT in the SELECT statement, but I want to use the statement commit for each 1,000 records.

How can I do this...
insert into emp_dept_master 
 select e.ename ,d.dname ,e.empno ,e.empno ,e.sal 
   from emp e , dept d
  where e.deptno = d.deptno       ------ how to use commit for every 1000 records .
Thank you

Method 4 is the best

You could combine method 3 and 1 (without dynamic SQL)

Method 2 is the less optimal solution from the list.

Tags: Database

Similar Questions

  • A license is required at the VASA? A license is required for each copy? VSI is necessary to have the VASA? They are mutually exclusive? VSI need NOTTM?

    A license is required at the VASA? A license is required for each copy? VSI is necessary to have the VASA? They are mutually exclusive? VSI need NOTTM?

    Thanks in advance.

    Assuming that you are referring to EMC arrays.

    License to the VASA: No.

    VSI required at the VASA: No. they work very well together, but does require that the other.

    VSI allowing VAAI: No. VAAI is active with or without the VSI.

  • to find the number of records retrieved in the select statement in the cursor

    Hi all
    with the cursor, I'm selecting select statement together and writing in the .txt file.
    his worksheet, but it should not open the file, if the cursor returns nothing.
    How to find the number of records returned by the select statement in the cursor.
    pls help me.

    Thank you...

    Don't understand what you're trying to say, but maybe it's...

    DECLARE
       vCounter NUMBER;
       -- Other variables...
    BEGIN
       vCounter:=0;
       FOR .. IN cursor LOOP
        IF vCounter=0 THEN
          -- Here open file...
          -- Here write one time data...
        END IF;
        -- Here write cursor data...
        vCounter:=1;
       END LOOP;
    END;
    

    -Clément

  • When I go to "Selection tool" and "Type tool" for example. I can't go back in the selection tool again. It is locked.

    When I go to "Selection tool" and "Type tool" for example. I can't go back in the selection tool again. It is locked.

    I did a fresh install, and the programme of work of the normally.

  • SHOW_LOV need to pass a parameter for the select statement

    Hello

    I have a requirement that there is only a drop down list but the display of the list should be based on the certern parameter.

    I have a table (id, type, description). The select statement for dropdown I need is

    SELECT id, description of the table where type = & input_param.

    Can someone help please!

    create a field and create value in the list select id, description from table1 where col =: block1.item

  • Menu Module v2 supported for the selected state?

    I can't understand if v2 menu module supports the selected state. I remember reading somewhere that it was planned to produce in the future, but it seems that the file /ModuleTemplates/Menu/Default/container.html has accommodations for her.

    A resource if so, it would be appreciated.

    By default I did, the JavaScript code is there in the updates page and not different from the normal version in this respect.

  • Record is not inserted into the transparent Table Forms 10g

    Hi all

    I have the built in 10g (10.1.2.0.2) form.

    Basically, the form has 2 blocks.
    1 block with a single element, where we enter a value and press on enter (this place you block2 and run the query).
    Block 2 (tabular) will get the records. This block2 have now 3 columns (caseid, userid, date).

    Now when I insert a new record, I just need to get the caseid only. And username and date must be filled in automatically.
    I can fill fields username and the DATE.
    And when I enter a value element of the block 2 caseid and then Control + S(to insert the record and Save the transaction),.
    I get the message saying FRM-40400: transactions: 1 applied and saved records.
    But when I ask again for the same thing, I do not have is the record inserted into the table.
    Why is this happening?

    Help please...

    Drop the trigger for INSERTION WE (do not comment code or write NULL) and move your code to INSERT before trying.

    -Clément

  • Is it possible to use the record type or a PL/SQL table in the Select statement

    Hi all

    My requirement is that.
    I want to write a query and write a function, function, I want to return multiple columns at the same time in a Select statement.
    I select the return values in the Select no statement in a PL/SQL block.
    Is it possible to use the PL/SQL Table or Variable of Type record, or any other method in the statement Select?

    Please help me understand the solution.


    Kind regards

    830960 wrote:
    do we like it?

    In general, Yes, if the function is a function table, you can do something like:

    select  t.col1,
            t.col2,
            f.col1,
            f.col2,
            f.col3
      from  table_name t,
               table(some_table_function(param1,...paramN)) f
    /
    

    SY.

  • How to use the select statement in loop for

    Hi all

    My question is can I use a select statement in for loop like as follows.

    for the key in the selection of one_table key.

    When I use this am getting an error as found select invalid I ID

    How to select a statement use in loop for

    Please suggest me.

    Thank you
    Sree

    Hello

    You can use code below

    For key in (select button from table_a)
    loop
    If key.key = 1 then
    -insert statement
    on the other
    -Select statement
    end loop;

    Thank you
    Naveen.

  • Not finding the correct syntax for the select statement

    Hello

    The following statement works very well and gives the expected results:
    prompt
    prompt Using WITH t
    prompt
    
    with t as
      (
       select a.proj_id,
              a.proj_start,
              a.proj_end,
              case when (
                         select min(a.proj_start)
                           from v b
                          where (a.proj_start  = b.proj_end)
                            and (a.proj_id    != b.proj_id)
                        )
                        is not null then 0 else 1
              end as flag
         from v a
        order by a.proj_start
      )
    select proj_id,
           proj_start,
           proj_end,
           flag,
           --
           -- the following select statement is what I am having a hard time
           -- "duplicating" without using the WITH clause
           --
           (
            select sum(t2.flag)
              from t t2
             where t2.proj_end <= t.proj_end
           ) s
      from t;
    As an academic exercise, I wanted to rewrite the above statement without using the WITH clause, I tried this (amongst dozens of other tests - I hit a mental block and cannot understand):
    prompt
    prompt without with
    prompt
    
    select c.proj_id,
           c.proj_start,
           c.proj_end,
           c.flag,
           --
           -- This is what I've tried as the equivalent statement but, it is
           -- syntactically incorrect.  What's the correct syntax for what this
           -- statement is intended ?
           --
           (
            select sum(t2.flag)
              from c t2
             where t2.proj_end <= c.proj_end
           ) as proj_grp
      from (
            select a.proj_id,
                   a.proj_start,
                   a.proj_end,
                   case when (
                              select min(a.proj_start)
                                from v b
                               where (a.proj_start  = b.proj_end)
                                 and (a.proj_id    != b.proj_id)
                             )
                             is not null then 0 else 1
                   end as flag
              from v a
             order by a.proj_start
           ) c;
    Thanks for the help, much appreciated.

    John.

    PS: The DDL for table v used by the above statements is:
    drop table v;
    
    create table v (
    proj_id         number,
    proj_start      date,
    proj_end        date
    );
    
    insert into v values
           ( 1, to_date('01-JAN-2005', 'dd-mon-yyyy'),
                to_date('02-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 2, to_date('02-JAN-2005', 'dd-mon-yyyy'),
                to_date('03-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 3, to_date('03-JAN-2005', 'dd-mon-yyyy'),
                to_date('04-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 4, to_date('04-JAN-2005', 'dd-mon-yyyy'),
                to_date('05-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 5, to_date('06-JAN-2005', 'dd-mon-yyyy'),
                to_date('07-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 6, to_date('16-JAN-2005', 'dd-mon-yyyy'),
                to_date('17-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 7, to_date('17-JAN-2005', 'dd-mon-yyyy'),
                to_date('18-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 8, to_date('18-JAN-2005', 'dd-mon-yyyy'),
                to_date('19-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 9, to_date('19-JAN-2005', 'dd-mon-yyyy'),
                to_date('20-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (10, to_date('21-JAN-2005', 'dd-mon-yyyy'),
                to_date('22-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (11, to_date('26-JAN-2005', 'dd-mon-yyyy'),
                to_date('27-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (12, to_date('27-JAN-2005', 'dd-mon-yyyy'),
                to_date('28-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (13, to_date('28-JAN-2005', 'dd-mon-yyyy'),
                to_date('29-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (14, to_date('29-JAN-2005', 'dd-mon-yyyy'),
                to_date('30-JAN-2005', 'dd-mon-yyyy'));
    select c.proj_id,
           c.proj_start,
           c.proj_end,
           c.flag,
           --
           -- This is what I've tried as the equivalent statement but, it is
           -- syntactically incorrect.  What's the correct syntax for what this
           -- statement is intended ?
           --
           (
            select sum(t2.flag)
              from (select a.proj_id,
                           a.proj_start,
                           a.proj_end,
                           case when (
                              select min(a.proj_start)
                                from v b
                               where (a.proj_start  = b.proj_end)
                                 and (a.proj_id    != b.proj_id)
                                     )  is not null then 0 else 1
                           end as flag
                      from v a
                     order by a.proj_start
                   ) t2
             where t2.proj_end <= c.proj_end
           ) as proj_grp
      from (
            select a.proj_id,
                   a.proj_start,
                   a.proj_end,
                   case when (
                              select min(a.proj_start)
                                from v b
                               where (a.proj_start  = b.proj_end)
                                 and (a.proj_id    != b.proj_id)
                             )
                             is not null then 0 else 1
                   end as flag
              from v a
             order by a.proj_start
           ) c;
    
  • Hello! How can I disable only Bill emails for each Stock photo/graphic and move on to the monthly bill? Is this possible? THX.

    Everythime I upload a Photo or an Illustration Stock I received an E-Mail. Is it possible to swith to monthly delivery?

    Please come back to me

    Kind regards

    Alex

    Hi Alex,

    It's not a way to do this, but I have forwarded your request to the product team. Thanks for the suggestion.

    EBQ

  • When I select print for a message preview mode, I get an error "the selected printer is not found." I can print the message, but I can't preview the output. I have

    I found that someone else has had this problem, but solution of Matt necessary use of the configuration editor. I followed the instructions, but by clicking on the Advanced tab, there was no Config Editor tab in order to execute the next step of the solution. BTW, I look in the console error log and see what: couldn't read the chrome manifest ' queue: / / / C:/Program % program % 20Thunderbird 20(x86) /Mozilla % 20Files / chrome.manifest'. The error itself is small box with Print Preview error as the label and The selected printer is not found as the contents of the box. Any help much appreciated.

    You look under Tools | Options | Advanced | General? In the main menu, which is the traditional one that spans the top of Thunderbird?

  • Media Center is Reporting insufficient disk space for each record programmed

    Since the upgrade to Windows 8 Media Center reports that there is not enough disk space for each scheduled TV recording despite there are currently more than 1 TB of free space. The programs record very well, but it is impossible to tell when it is a genuine issue (for example, a program conflict) as an indicator of each scheduled recording is also problematic.

    There is a simple solution to this in Media Center as an administrator (which implies that there may be a problem of permissions with Windows 8). However, I also use an XBox 360 as an Extender and there is no known method to apply this workaround to an Extender then it continues to be a lack of disk space for each unique record.

    I tried completely removing the recorded TV folder, followed by a reboot to allow Media Center services recreate the folder, but it does not solve the problem. I checked all the settings and Media Center reports that it has enough free space to save more than 400 hours of television, but he's still complaining lack of disk space for each individual scheduled recording.

    Any ideas?

    I found a solution that worked for me on another thread.

    See the post from Steve Scoltock on executing a recovery job in the computer management application, here:
    http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-Winapps/Windows-8-TV-recording-problem-with-Windows-Media/f9695954-246F-4C59-8d1b-3729a81feee9?page=1&TM=1352456456164

    It worked for me.  I hope this guy helps too.

  • loops through the sections XML &lt; RecieptDetails &gt; and for each record found...

    My input XML file is...
    I get this XML using file adapter...

    <? XML version = "1.0" encoding = "UTF-8"? >
    -< root xmlns:ns2 = "http://www.w3.org/2001/XMLSchema" >
    -< ns2:ReceiptBatch >
    < ns2:FileID > "99999" < / ns2:FileID >
    < ns2:Warehouse > in THE < / ns2:Warehouse >
    'L' < ns2:Revision > < / ns2:Revision >
    < ns2:DocID > A4 < / ns2:DocID >
    -< ns2:Receipt >
    < ns2:DeliveryNo > 123 - OP < / ns2:DeliveryNo >
    < ns2:ProcessDate > 112138 < / ns2:ProcessDate >
    < ns2:ContainerNo > 98765 < / ns2:ContainerNo >
    < ns2:Instructions > TREKAU < / ns2:Instructions >
    < ns2:ReceiptType > 1 < / ns2:ReceiptType >
    < ns2:SuppCustCode > 111 < / ns2:SuppCustCode >
    TREK-Cycle < ns2:SuppCustName > < / ns2:SuppCustName >
    -< ns2:ReceiptDetails >
    < ns2:Line > 1 < / ns2:Line >
    < ns2:ProductCode > 1000 < / ns2:ProductCode >
    < ns2:QuantityAdvised > 1 < / ns2:QuantityAdvised >
    < ns2:QuantityReceived > 1 < / ns2:QuantityReceived >
    < / ns2:ReceiptDetails >
    -< ns2:ReceiptDetails >
    < ns2:Line > 2 < / ns2:Line >
    < ns2:ProductCode > 2000 < / ns2:ProductCode >
    < ns2:QuantityAdvised > 2 < / ns2:QuantityAdvised >
    < ns2:QuantityReceived > 2 < / ns2:QuantityReceived >
    < / ns2:ReceiptDetails >
    -< ns2:ReceiptDetails >
    < ns2:Line > 3 < / ns2:Line >
    < ns2:ProductCode > 2000 < / ns2:ProductCode >
    < ns2:QuantityAdvised > 3 < / ns2:QuantityAdvised >
    < ns2:QuantityReceived > 3 < / ns2:QuantityReceived >
    < / ns2:ReceiptDetails >
    < / ns2:Receipt >
    < / ns2:ReceiptBatch >
    < / root >

    There are 2 tables in the database.
    Table 1 = T1743512
    Table 2 = T2743002

    table - structure

    T1743512-

    DOCO KCOO DTCO LNID LNIX LITM NOTICE USR JOBN UPMJ PID'M CKNU UREC
    123 00026 1 1 1000 1 1 123 - OP OP
    124 00026 1 1 1000 1 1 124 - OP OP
    123 00026 2 2 1000 2 2 123 - OP OP
    123 00026 3 3 1000 3 2 123 - OP OP



    Things to do are:--

    1. Research Notice T1743512 (table) with the following keys:
    1.T1743512. CKNU = < DeliveryNo > XML
    2.T1743512. LNIX = XML < row >
    II. write a record in the T2743002 table for each < RecieptDetails >. (See map below)

    Mapping of the records in the table T2743002 to < ReceiptDetails >

    EDU - "SABSSV".
    EDBT - < EDBT > (the same for all records)
    EDTN - < DeliveryNo > (from the section < reception > XML)
    EDLN - < row > (from < ReceiptDetails > section in XML format)
    EDSP - white
    DOCO - white
    DCTO - white
    KCOO - white
    LNID - white
    LITM - < ProductCode > < ReceiptDetails > section
    UORG - < QuantityAdvised > < ReceiptDetails > section
    UREC - < QuantityReceived > < ReceiptDetails > section
    USER - "SABSSV".
    JOBN - "SOA - 3PL".
    PID - 'PO-ENTRANTS ".
    UPMJ - current Date Julian
    - Hour current HHMMSS



    Please suggest the solution.

    Published by: Prashant_AP on June 22, 2012 12:24 AM

    Hello

    Solution by using a loop in BPEL;
    1 count the number of nodes for ReceiptDetails.
    2 create a counter for loop through each node ReceiptDetails. Use a while loop in BPEL
    3 search T1743512 (table) with DeliveryNo and the line. Make sure that you select the correct line from the ReceiptDetails node element node. This can be done using the counter example of xpatch ns2:ReceiptBatch / ns2:Receipt / ns2:ReceiptDetails [counter] / ns2:Line. Please use the DB adapter.
    I guess that the DeliveryNo can only appear once in the document following your example.
    4. for each receiptDetails you write a record in table too T2743002. Please use the DB adapter.
    5. Since the time increment the counter. This is to ensure that the while loop stops at the point where the counter is greater then the number of nodes to ReceiptDetails.

    I think a better solution is to make the loop in PL/SQL. It will be faster. You specify an input of type of collection in your pl/sql package parameter. Assign all items receiptDetails and DeliverNo line to the PL/SQL package. Within PL/SQL unravel you the closure. With a little luck, you have the T2743002 in the same schema to create the record too. Otherwise create synonyms of the database or database links.

    Good luck

    Thank you

    Sander

  • Stored procedure or Tigger in order to update to 20,000 records every night?

    Hello world

    I have a question about stored procedure or trigger.

    Here's the situation:

    I need to empty 20,000 records in table A in the database of progress to a B in Oracle table, every night. This is done by a planner and it's fine. Now, I need to update the table C for these 20,000 records in table B, either during the discharge of A to B, or after the dump is done.

    Which way you think it's better in terms of performance for 20,000 records to be updated in table C.

    1 - Update table C in the discharge of A to b: specify a trigger for each record added to table B, do the update in table c. (meaning it will unleash 20,000 times)

    2 - Update table C after the dump from A to B is done: specify a stored procedure and call it by a scheduler to do the update to table C (which means that the cursor must navigate 20,000 files and do the update for each of them in table C)


    Any ideas would be greatly appreciated.

    Mona

    I agree that the second option is better, but it took me by surprise:

    user2372480 wrote:
    2 - Update table C after the dump from A to B is done: specify a stored procedure and call it by a scheduler to do the update to table C (* which means that the cursor must navigate 20,000 files and do the update for each of them in table C *)

    I interpreted that as a record by the other treatment as in:

    OPEN CURSOR
    LOOP
    -- update a single record here
    END LOOP
    

    If this is the case, try and combine all the updates in a single SQL statement if you can. If this is not the case, try treatment in bulk.

    HTH!

Maybe you are looking for