Question related to the INSERT statement

Imagine this scenario:

-table_a has 5 000 000 records at time t1

-table_b is empty at time t1

-At time t1, I execute the following statement:
          insert into table_b
            select * from table_a;
    
-L' insert statement ends in time t2

-Between t1 and t2, say 3 000 new records have been added to the table_a (by OLTP processes).
Thus, at time t2, table_a has 5 003 000 records.

My question is, at time t2, the number of records will be in table_b? Will it 5,000,000 or
5 003 000 or somewhere between these two counts?

I guess it will be 5,000,000 because that is the number when the insert statement
has started to run.

Any comment is appreciated.

Syed Ullah says:
Imagine this scenario:

-table_a has 5 000 000 records at time t1

-table_b is empty at time t1

-At time t1, I execute the following statement:

insert into table_b
select * from table_a;

-L' insert statement ends in time t2

-Between t1 and t2, say 3 000 new records have been added to the table_a (by OLTP processes).
Thus, at time t2, table_a has 5 003 000 records.

My question is, at time t2, the number of records will be in table_b? Will it 5,000,000 or
5 003 000 or somewhere between these two counts?

I guess it will be 5,000,000 because that is the number when the insert statement
has started to run.

Any comment is appreciated.

At time t2, it is possible that the answer is 0. Once the insert operation finishes (can be any time after t1 in your example, possibly before t2, possibly after) and assuming you checked in the same session where you run the insert, you would see 5 000 000. In other sessions you would continue to see 0 up to what the session who made the done insert one COMMIT.

http://docs.Oracle.com/CD/E11882_01/server.112/e25789/consist.htm#CNCPT121

Is something that you should read. He described these concepts much better than what you'll probably find in a few posts on the forum.

Tags: Database

Similar Questions

  • Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Hello

    2796614 wrote:

    Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Of course, it is possible.  According to what the text file looks like to, you can create an external table that treats the text file as if it were a table.  Otherwise, you can always read the file in PL/SQL, using the utl_file package and INSERT of PL/SQL commands.

    You have problems whatever you wantt?  If so, your zip code and explain what the problem is.

    Whenever you have any questions, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the exact results you want from these data, so that people who want to help you can recreate the problem and test their ideas.  In this case, also post a small sample of the text involved file.

    If you ask about a DML operation, such as INSERT, then INSERT statements, you post should show what looks like the tables before the DML, and the results will be the content of the table changed after the DML.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

  • need help to create the insert statement

    I have customer_priv of table which has 4 columns (login, privilize_id, adate, added_by)

    the stmt insert like "insert into customer_priv values('JDOE',951.sysdate,admin);

    I have 100 users and for each user, I need to add to the 15 privilize_id

    I have the list of connections and roles, what is the best way to create a massive insert for all those users statement and

    any help is very appreciated

    Thank you

    user11984714 wrote:
    Thanks Frank

    I get the below now.what Miss. Also is it possible to reel in a file insert rather directly the data.am I missing values?

    Sorry, I don't understand what you want.
    You say you want to write something in a HOLD file instead of insert? Of course, you can do it. Change the INSERT statement in a SELECT statement and add commands to the COIL.

    SQL > @c:\insert_many.sql
    33 old: SELECT ' & 1' priv_id, 'admin', sysdate)
    33 News: SELECT sysdate, "BNELSON", "admin", priv_id)

    Of all_priv_id
    *
    ERROR on line 34:
    ORA-00923: THE KEYWORD not found where expected
    Thank you

    Published by: user11984714 on August 9, 2010 18:40

    Sorry, there was a typing error in my previous post.
    Remove the ')' the end of the

    SELECT     '&1', privilze_id, SYSDATE, 'admin')
    

    I hope that you have more problems, but if you do, post your code, even if you think that you just copied it from this site.

  • Need help with the insert statement

    Hello

    I have a question on how to write a SQL statement.

    This is the table of "base":
    CREATE TABLE TEMP_TBL
    (
    id_nr NUMBER,
    DATE_DOK DATE,
    DATE_DUE DATE,
    DATE_DOK_PAY DATE,
    DEB NUMBER,
    KRD NUMBER
    );
    
    insert into temp_tbl (ID_NR,DATE_DOK,DATE_DUE,DATE_DOK_PAY,DEB,KRD)values('1',TO_DATE('11.01.2011','DD.MM.YYYY'),TO_DATE('25.02.2011','DD.MM.YYYY'),NULL,'423,24','0');
    insert into temp_tbl(ID_NR,DATE_DOK,DATE_DUE,DATE_DOK_PAY,DEB,KRD)values('2',TO_DATE('16.12.2011','DD.MM.YYYY'),TO_DATE('13.06.2011','DD.MM.YYYY'),NULL,'91270,15','0');
    insert into temp_tbl(ID_NR,DATE_DOK,DATE_DUE,DATE_DOK_PAY,DEB,KRD)values('3',TO_DATE('27.09.2011','DD.MM.YYYY'),TO_DATE('27.09.2011','DD.MM.YYYY'),NULL,'0','2000');
    and it comes to resoult in the target table. SQL statement must take care of the insert in a base of the target table table (example below is already provided with test data).
    create table table_sod
    (
    
          id_nr number
         ,date_from date
         ,date_to date
         ,deb_krd number
    
    );
    
    One thing to note here :  values in column deb_krd under insert 1 and 4 must be summarized in insert 4.
    
    insert into table_sod (id_nr,date_from,date_to,deb_krd) values('1',null,to_date('25.02.2011','dd.mm.yyyy'),'423,24');
    insert into table_sod(id_nr,date_from,date_to,deb_krd) values('2',to_date('26.02.2011','dd.mm.yyyy'),to_date('13.06.2011','dd.mm.yyyy'),'423,24');
    insert into table_sod(id_nr,date_from,date_to,deb_krd)values('3',null,to_date('13.06.2011','dd.mm.yyyy'),'91270,15');
    insert into table_sod(id_nr,date_from,date_to,deb_krd)values('4',to_date('14.06.2011','dd.mm.yyyy')to_date('27.09.2011','dd.mm.yyyy'),'91693,39');
    insert into table_sod(id_nr,date_from,date_to,deb_krd)values('5',null,to_date('27.09.2011','dd.mm.yyyy'),'2000');
    If someone could give me a helping hand how write correct insert statement I would be really gratefull.

    Thank you for your time!

    I came here with my own assumptions with this

    SQL> select rownum id_nr
      2       , date_from
      3       , date_to
      4       , case when date_from is null then deb
      5              else sum(case when date_from is not null then deb else 0end) over(order by id_nr, no)
      6         end deb_krd
      7    from (
      8            select id_nr
      9                 , case when lg_dt is null or ld_dt = date_due then  null else lg_dt+1 end date_from
     10                 , ld_dt date_to
     11                 , case when deb = 0 then krd else deb end deb
     12                 , no
     13              from (
     14                      select t1.*
     15                           , lead(t1.date_due) over(order by t1.id_nr, t2.no) ld_dt
     16                           , lag(t1.date_due) over(order by t1.id_nr, t2.no) lg_dt
     17                           , t2.no
     18                        from temp_tbl t1
     19                       cross
     20                       join (select 1 no from dual union all select 2 no from dual) t2
     21                       order by id_nr, no
     22                   )
     23             where ld_dt is not null
     24         )
     25  /
    
         ID_NR DATE_FROM DATE_TO      DEB_KRD
    ---------- --------- --------- ----------
             1           25-FEB-11      42324
             2 26-FEB-11 13-JUN-11      42324
             3           13-JUN-11    9127015
             4 14-JUN-11 27-SEP-11    9169339
             5           27-SEP-11       2000
     
    
  • Help with the insert statement

    Hello

    I was wondering if someone could help write me a sql statement.

    Here is my table:
    CREATE TABLE "TEMP_INVOICE" 
       ("INVOICE" VARCHAR2(100 BYTE),
         "DATE_OF_DOCUMENT" DATE, 
         "DATE_OF_PAY_DAY" DATE, 
         "D" NUMBER, 
         "K" NUMBER
       );
    Here are the instructions for correct insertion. This time, I posted 2 examples with 2 numbers different otherwise.
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.02.2012','dd.mm.yyyy'),to_date('01.03.2012','dd.mm.yyyy'),5000,0);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.04.2012','dd.mm.yyyy'),'','',1000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.05.2012','dd.mm.yyyy'),'','',3000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.06.2012','dd.mm.yyyy'),'','',1000);
    
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.07.2012','dd.mm.yyyy'),to_date('01.09.2012','dd.mm.yyyy'),8000,0);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.10.2012','dd.mm.yyyy'),'','',5000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.11.2012','dd.mm.yyyy'),'','',2000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.12.2012','dd.mm.yyyy'),'','',1000);
    I want to do is make an insert allows you to table another call is MADE:
    CREATE TABLE "INVOICE" 
       ("INVOICE" VARCHAR2(100 BYTE),
        "DATE_OF_DOCUMENT" DATE, 
         "DATE_OF_PAY_DAY" DATE,
         "DATE_OF_PAYMENT_REC" DATE,
         "VALUE" NUMBER,
         "VALUE_DEDUCT" NUMBER,
        "DATE_FROM" DATE,     
         "DATE_TO" DATE
         );
    Statements in the INVOICE table should be like this:


    ........ The Bill... date_of_document... date_of_pay_day... date_of_payment_rec... value... value_deduct... Date_from... Date_to
    1......     1000...............1.1.2012.................1.3.2012................NULL............................ 5000... NULL... 1.3.2012...1.4.2012
    2......     1000...............1.4.2012.................NULL..................... 1.4.2012...1000... 4000... 2.4.2012... 1.5.2012
    3......     1000...............1.5.2012.................NULL..................... 1.5.2012...3000... 1000... 2.5.2012... 1.6.2012
    4......     1000...............1.6.2012.................NULL..................... 1.6.2012...1000


    Can someone help me with the sql statement that would insert data from table to table Bill temp_invoice as in the example?

    Thank you!

    PS

    I would try to explain.
    (1) the first statement that is to be inserted is original imply that at which is different DATE_OF_PAY_DAY to NULL.
    To this inserted negative of the original imply, we must add date_from that is exatly the same date_of_pay_day and date_to which is exactly the same as the date of the first payment. Payment which came first!
    (2) we have now in the second insert statement. It will be the first payment of lease with date_of_document and date_pf_payment_rec, which is the same as date_fo_document. Value field will be populated with the amount of payment received and value_deduct field will be the value of the original imply - value of the first payment. Date is date_of_document + 1 and date_to is the date of the next payment.
    (3) Insert us the next installment. Date_od_payment_rec is the same as date_of_document... value is the amount of the second payment and value_deduct's previous value_deduct which was of 4000 - value of this second payment. date_from date_of_payment_rec + 1 and date_to is the date of the next payment

    So we continue this same pattern until we reached the final payment when we finish insert with the statement:
    Date of the document (date of the last payment received) and even for date_of_payment_rec and field value with the amount of the payment receieved. The rest (value_deduct, date_from, date_to) is null.

    I really hope you understand what I'm trying to do here.

    If you have any other questions please.

    Published by: user13071990 on November 22, 2012 04:16

    Published by: user13071990 on November 22, 2012 04:16

    Hello

    user13071990 wrote:
    ... Here are the instructions for correct insertion. This time, I posted 2 examples with 2 numbers different otherwise.

    Ok!
    Be sure to post the results you want new data.

    You probably need to add "PARTITION BY the Bill" to all analytical clauses in my solution:

    INSERT INTO invoice
    ( invoice, date_of_document, date_of_pay_day, date_of_payment_rec
    , value,   value_deduct,     date_from,           date_to
    )
    SELECT       invoice
    ,       date_of_document
    ,       date_of_pay_day
    ,       CASE
               WHEN  k > 0
               THEN  date_of_document
           END          AS date_of_payment_rec
    ,       NVL (d, k)     AS value
    ,       NVL2 ( date_of_pay_day
                , NULL
                , SUM (d) OVER ( PARTITION BY  invoice
                                          ORDER BY      date_of_document
                         )
                - SUM (k) OVER ( PARTITION BY  invoice
                                          ORDER BY      date_of_document
                         )
                )     AS value_deduct
    ,       NVL ( date_of_pay_day
               , date_of_document + 1
               )          AS date_from
    ,       LEAD (date_of_document) OVER ( PARTITION BY  invoice
                                            ORDER BY      date_of_document
                               )
                          AS date_to
    FROM       temp_invoice
    ;
    

    Because I'm not an English speaker nativ, that I just posted what it should look like after the insert is successful.

    OK, so you can't explain as you want, but you still need to explain.

    ... @Frank Kulash: you are very close, but still not quite what I'm looking for.

    Point out where my solution is the production of incorrect results, and explain (as you can) how to get good results in these places.

  • Decode in the insert statement

    Hi friends,

    I use an insert select with decode function as below... I get the error Ora-01722 invalid number

    insert into table (name, user...) tNom

    Select col1, col2,...,.

    Decode (tab2. COL4, 'AF','(susbstr (tab2. COL8, 1, 5). » -'|| substr (tab2. COL8, 6))', tab2. COL8) COL8,.

    ....

    of tname2 tab2

    The two tNom. COL8 and tab2.col8 are varchar fields...  Please let me know if something escapes me in the DECODE statement...

    Thank you very much

    >,'(susbstr (tab2

    You have single quotes around your substr function calls.

  • Looking for a better style or a way to write the INSERT statement, possible with brand of continuation

    Honestly, I really looked everywhere for this.

    The problem is that, while tinkering in SQL Developer and knowing that in the spreadsheet I can just execute individual instructions by placing the cursor on the SQL statement I want to run I tried to do an INSERT query that would allow me to run an INSERT statement for... Well many inserts.

    I thought I could use a brand of continuation but nothing I've tried has worked.

    INSERT INTO

    HF_easy_drinks

    VALUES

    ("Blackthorn", "tonic water", 1.5, 1.0, "pineapple juice", "mix with ice").

    ("Blue Moon", "soda", 1.5 "Blueberry Juice",. 75, "mix with ice, strain")

    ;


    I ended up doing just individual INSERT statements, which was not as convenient.

    INSERT INTO HF_easy_drinks

    VALUES ('Blackthorn', 'tonic water', 1.5, 1.0, "pineapple juice", "mix with ice");

    INSERT INTO HF_easy_drinks

    VALUES ('Blue Moon', 'soda', 1.5, 'Blueberry Juice',. 75, "mix with ice");

    Hello

    Perhaps you might prefer "an" insert like this:

    INSERT INTO hf_easy_drinks (x, y, z,...)
    SELECT "Blackthorn", "tonic water", 1.5, 1.0, "pineapple juice", "mix with ice" OF THE double
    UNION ALL SELECT 'Blue Moon', 'soda', 1.5, 'Blueberry Juice',. 75, "mix with ice, strain ' FROM dual
    SELECT UNION ALL... OF the double
    SELECT UNION ALL... OF the double
    ;

    Best regards

    Bruno Vroman.

  • On the insert statement

    Hi all

    I need to insert rows into a table, all the columns are have same value except a column that is to say


    insert into table values ('a', 'b', 'b', 'b');

    insert into table values ('b', 'b', 'b', 'b');

    Insert in the table values ('b', 'b', 'c', 'b');

    y at - there no shortcut for insert because there are thousands of records to insert

    Help, please

    Thank you

    If data are available in another table, you can use a select statement inside your insert statement.

    Incomplete example

    NSERT INTO TABLE (
      COL1,
      COL2,
      COL3,
      COL4
    
    )
    SELECT FROM OTHERTABLE WHERE...,
    'b'
    'b'
    'b'
    ...
    

    The doc show this as an example:

    INSERT INTO AIRPORTS (AIRPORT, CITY, COUNTRY)
      SELECT AIRPORT, CITY_NAME, COUNTRY FROM CITIES
      ORDER BY AIRPORT;
    

    SELECT yourvalue, 'b', 'b', 'b' of...

    Best regards

    mseberg

    Published by: mseberg on October 6, 2012 08:31

  • trigger for the insert statement

    Hello.
    I have a table, say, with 3 columns: ID, NAME, NAME_LENGTH.
    I am trying to create a trigger that fires when a record is inserted in the table.
    I send values for the ID and NAME columns per INSERT statement. and I need the trigger to write the LENGTH OF THE NAME INSERTED in the 3rd column

    CREATE OR REPLACE TRIGGER schema_name. GENERATE_length
    AFTER INSERT ON table_name
    FOR EACH LINE
    DECLARE
    F NVARCHAR2 (200);
    L NUMBER (5);
    NL NUMBER (5);
    NUMBER OF ID_LENGTH (5): = 5;
    BEGIN
    F: =:New.Name;

    L: = LENGTH (F);

    UPDATE HR_ORG_TREE

    SET name_length = NL;

    END;


    but does not work. error occurres as...

    ORA-04091: table schema_name.table_name is changing, the function of triggering/can not see
    ORA-06512: at the 'schema_name '. GENERATE_length', line 13
    ORA-04088: error during execution of trigger ' schema_name. GENERATE_length'

    Thank you.
    Sara
    CREATE OR REPLACE TRIGGER schema_name.GENERATE_length
        -- is "table_name" real name of your table?
        AFTER INSERT ON table_name
        FOR EACH ROW
    BEGIN
        -- this update will change all rows in HR_ORG_TREE table
        -- specify WHERE for this update
        UPDATE HR_ORG_TREE
           SET name_length = LENGTH(:NEW.name);
    END;
    

    Suppose your table_name is HR_ORG_TREE and you need to calculate the length of the name for just inserted row
    After maybe the code will be useful (not tested)

    CREATE OR REPLACE TRIGGER schema_name.GENERATE_length
        BEFORE INSERT ON HR_ORG_TREE
        FOR EACH ROW
    BEGIN
        :new.name_length := LENGTH(:NEW.name);
    END;
    

    Good luck

  • Generate the insert statement using columns in view all_tab_cols

    I am trying to generate a dynamic insert statement using the columns of a table in the all_tab_cols view. If I do a select, I get the result as lines. How to convert the row of the columns so that I get something like this:
     INSERT INTO TABLE_NAME (COL1, COL2, COL3,COL4.....) 
    .

    Any help will be appreciated!

    This can give you a tip.

    SQL> ed
    Wrote file afiedt.buf
    
      1  with tab_col
      2  as
      3  (
      4  select i.table_name,
      5         column_name,
      6         row_number() over(partition by i.table_name order by table_name) rno
      7    from user_tab_cols i
      8  )
      9  select 'INSERT INTO '||table_name||' ('||ltrim(sys_connect_by_path(column_name, ','), ',')||')
     10    from tab_col
     11   where connect_by_isleaf = 1
     12   start with rno = 1
     13  connect by rno = prior rno+1
     14     and table_name = prior table_name
     15* and rownum<4
    SQL> /
    
    SQL_STATEMENT
    --------------------------------------------------------------------------------
    INSERT INTO A (MAKER,TYPE)
    INSERT INTO ADAM_TEST (ACCT,CODE)
    INSERT INTO AREA_TBL (AREA_ID,ORG_ID,CLUSTER_ID)
    INSERT INTO B (MAKER)
    INSERT INTO BONUS (ENAME)
    INSERT INTO CLUSTER_TBL (CLUSTER_ID)
    INSERT INTO COMPANY (MANUFACTURER)
    INSERT INTO COUNTRIES (COUNTRY_ID)
    
  • value of the check box in the insert statement

    I'm hand-coding an insert from the insert record sb construction will do for this application. The values of several form elements are inserted into the fields in the table. The problem that occur is a checkbox value in the form. If the box is checked, all is well and the value is 'True' inserted in the appropriate database field. However, if the checkbox is not checked I get syntax error message. The reason being that, while are passed on to the fields with null null, the checkbox is not transmitted at all. This is evident when changing the method of the form to 'Get' for testing purposes. There is no reference to this field check box in the query string.

    My assumption is that this would require an If statement changing the value of the 'False' check box when the box is blocked. How I would go to this topic. With my knowledge limited to the ASP, I wrote the following, but it doesn't seem to work:

    < input name = "emailprob_mor" type = "checkbox" id = "emailprob_mor" value = "< % If Not (IsNull (Request.Form ("emailprob_cus")) then Response.Write"True") Else Response.Write ("False") End If % >" >

    When you use the boxes, it is better to separate your Request.Form statement and your insert statement:

    cbVal = '0 '.
    If (Request.Form ("emailprob_mor") <> "") then cbVal = Request.Form ("emailprob_mor")

    Then in your SQL statement:

    "& cbVal &"..."

    For your real HTML:

    "" ) then response.write(" checked='checked' ") %>>

    It is true that if the user does not check the box, then it appears as if there is no when it is submitted, that is the reason why he must be given a default value when the record is inserted.

  • How to retrieve the value from the insert statement

    Hello
    How can I get a certain value of the insert and store it in a variable.
    Suppose that I am inserting emp_no, emp_name, emp_salary for the employee table
    and I want to record the emp_name in a variable for further processing,
    How can I accomplish this? I guess I should use the trigger,
    but do not know the procedure.
    any help will be greatly appreciated
    Thank you

    insert into

    values (...) return in

    You can and should have found that using the SQL language reference manual
    or
    http://www.morganslibrary.org/reference/insert.html

    --------
    Sybrand Bakker
    Senior Oracle DBA

  • CASE of PL/SQL in the INSERT statement

    I'm trying to insert a record into a table, change the value of the field in the insert based on a condition. To simplify the code:
    DECLARE
    
      true_or_false BOOLEAN;
    
    BEGIN
    
      true_or_false := FALSE;
          
      INSERT INTO table1
      (column1)
      VALUES
      (CASE WHEN true_or_false = FALSE THEN 0 ELSE -1 END);
      
    END;
    It of something that I can do in SQL Server but do not understand the right Oracle syntax. Can someone help me please?

    If the BOOLEAN data type is allowed for the PL/SQL variable, it is not in a query.
    Something like that:

    SQL> DECLARE
      2    true_or_false BOOLEAN:= FALSE;
      3    var number;
      4  BEGIN
      5    if true_or_false then var:=-1; else var:=0; end if;
      6    INSERT INTO table1
      7    (column1)
      8    VALUES
      9    (var);
     10  END;
     11  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select * from table1;
    
       COLUMN1
    ----------
             0
    

    Nicolas.

  • Question about the use of sequence in the INSERT statement

    Hello
    I have a problem with inserting data into a table. I created a sequence...
    CREATE SEQUENCE ag_in_target_seq
    INCREMENT BY 1 
    START WITH 1
    ;
    and Im trying to use it to insert an incrementing ID value in a column for the newly created table. Im getting an error message regarding the sequence.
    "The specified sequence (CURRVAL and NEXTVAL) number is inappropriate here in education."
    I just started looking at sequences, but not sure of my logic or syntax. (little a noob). If someone could point me in the right direction it would be much appreciated. Thanks to a witness of anomaly.
    INSERT INTO AGENTSINFOTARGET
    SELECT     
               a.code_name,
               i.information_id,
               i.gleaned_date,
               t.first_name,
               t.last_name,
               l.description,
               ag_in_target_seq.nextval
    FROM
               agents a
               INNER JOIN
               information i ON
               a.agent_id=i.agent_id
               INNER JOIN
               targets t ON
               i.target_id=t.target_id
               INNER JOIN
               locations l on
               t.location_id=l.location_id
               ORDER BY
               a.code_name desc 
      ;

    remove the order by clause. Or if you really want to match the id with the name, and then apply the sequence after you ordered.

    not tested

    INSERT INTO AGENTSINFOTARGET
    select s.code_name, s.information_id, s.gleaned_date, s.first_name, s.last_name, s.description
            ,ag_in_target_seq.nextval
    from
      (SELECT
               a.code_name, i.information_id, i.gleaned_date, t.first_name, t.last_name, l.description
      FROM  agents a
      JOIN information i ON a.agent_id=i.agent_id
      JOIN targets t ON i.target_id=t.target_id
      JOIN locations l on t.location_id=l.location_id
      ORDER BY a.code_name desc
      ) s
    ;
    

    But without an order by clause, it would be much better.
    This sequence if he lies later as a primary key, then there is no logical reason for any specific order.

    Published by: Sven w. on August 13, 2009 15:39

    Published by: Sven w. on August 13, 2009 15:43 - readbility improved statement

  • Memory problems and questions related to the process

    Does this look just for you, because the modified memory does little until after I had computer problems and had to do a factory reset

    The operating system is Windows 7 64-bit edition SP1

    I disabled SuperFetch is told by the way, if this help anyone on this issue.

    Resource monitor

    Windows process

    Services

    Performance

    Hello

    When your computer doesn't have enough memory for all the actions it is trying to perform, Windows and your programs can stop working. To help prevent information loss, Windows will inform you when your computer is low on memory. You can also learn to recognize the signs of low memory and take measures to prevent the problem. Insufficient memory problems occur when your computer is running out of RAM and becomes virtual memory. This can happen when you run more programs that the RAM memory installed on the computer is designed to support. Low-memory problems can also occur when a program free up memory that it needs more. This problem is called memory overuse or a memory leak.

    You can consult the following Microsoft articles and check if it helps.

    Diagnosing memory problems on your computer

    http://Windows.Microsoft.com/en-AU/Windows7/diagnosing-memory-problems-on-your-computer

    Prevention of problems of memory

    http://Windows.Microsoft.com/en-AU/Windows/preventing-low-memory-problems#1TC=Windows-7

    You may receive an "Out of Memory" error message because of the limitation of in Windows Vista or Windows 7 desktop heap

    http://support.Microsoft.com/kb/947246

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: http://windows.microsoft.com/en-US/windows7/Back-up-the-registry

    I hope this helps.

    Please post back with the State of the question and we will be happy to help you further.

Maybe you are looking for

  • Migration strategy

    I use now on a late 2009 27 "iMac with OSX 10.10.5. My new iMac 27 "OSX 10.11 arrived on Monday. I think I want to do a clean installation of applications and preferences. The user account that I have now been migrated permanently and updated since 2

  • Satellite P200 - 17 c - Windows 7 Tools & Utilities Toshiba

    Hello I have a few questions about my Toshiba P200 - 17 c, but I don't know if I should post in the forum by Satellite, the forum of operating system or Toshiba forum tools & utilities but, because my questions concern all three forums and questions

  • Move the start icon & clock down to moniter

    somehow my clock icon & start is moved to the top of the moniter how tdo you your choice down to the moniter

  • Unable to connect to the internet using Google or Windows Live Mail access

    I have an Acer laptop with Windows 7.  Every time I have to connect to the Internet via Google, or attempt to access my emails on Windows live mail, it takes forever to connect to the time and the high bar always notes that Windows does not.  Please

  • Vista operating system and 2610xi all-in-one Photosmart

    Where can I download software for vista 32 bit os and hp printer photosmart 2610xi all-in-one? He worked for two years on my network and now it will not recognize my os.