Question related to INSERT statement

Consider 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;
    - The insert statement finishes at time t2
- Between t1 and t2, say 3,000 new records were added to table_a (by OLTP processes).
So at time t2, table_a has 5,003,000 records.
My question is, at time t2, how many records will be in table_b? Will it be 5,000,000 or
5,003,000 or somewhere between these two counts?
I am guessing it will be 5,000,000 since that was the number when the insert statement
started to execute.
Any feedback is much appreciated.

Syed Ullah wrote:
Consider 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; - The insert statement finishes at time t2
- Between t1 and t2, say 3,000 new records were added to table_a (by OLTP processes).
So at time t2, table_a has 5,003,000 records.
My question is, at time t2, how many records will be in table_b? Will it be 5,000,000 or
5,003,000 or somewhere between these two counts?
I am guessing it will be 5,000,000 since that was the number when the insert statement
started to execute.
Any feedback is much appreciated.At time t2 it's possible the answer is 0. Once the insert operation finishes (could be any time after t1 in your example, possibly before t2, possibly after) and assuming you checked within the same session where you ran the insert, you'd see 5,000,000. In other sessions you would continue to see 0 until the session that performed the insert did a COMMIT.
http://docs.oracle.com/cd/E11882_01/server.112/e25789/consist.htm#CNCPT121
Is something you should be reading. It outlines these fundamental concepts much better than you're likely going to find in a few forum posts.

Similar Messages

  • Bulk Load question for an insert statement.

    I'm looking to put the following statement into a FORALL statement using BULK COLLLECT and I need some guidance.
    Am I going to be putting the SELECT statement into a cursor and then load the cursor values into a defined Nested Table type defined variable?
    INSERT INTO TEMP_ASSOC_CURRENT_WEEK_IDS
    SELECT aor.associate_office_record_id ,
    sched.get_assoc_sched_rotation_week(aor.associate_office_record_id, v_weekType.start_date) week_id
    FROM ASSOCIATE_OFFICE_RECORDS aor
    WHERE aor.OFFICE_ID = v_office_id
    AND (
    (aor.lt_assoc_stage_result_id in (4,8)
    AND v_officeWeekType.start_date >= trunc(aor.schedule_start_date)
    OR aor.lt_assoc_stage_result_id in (1, 2)
    ));

    I see people are reading this so for the insanely curious here's how I did it.
    Type AOR_REC is RECORD(
    associate_office_record_id dbms_sql.number_table,
    week_id dbms_sql.number_table); --RJS.***Setting up Type for use with Bulk Collect FORALL statements.
    v_a_rec AOR_REC; -- RJS. *** defining variable of defined Type to use with Bulk Collect FORALL statements.
    CURSOR cur_aor_ids -- RJS *** Cursor for BULK COLLECT.
    IS
    SELECT aor.associate_office_record_id associate_office_record_id,
    sched.get_assoc_sched_rotation_week(aor.associate_office_record_id, v_weekType.start_date) week_id
    FROM ASSOCIATE_OFFICE_RECORDS aor
    WHERE aor.OFFICE_ID = v_office_id
    AND (
    (aor.lt_assoc_stage_result_id in (4,8)
    AND v_officeWeekType.start_date >= trunc(aor.schedule_start_date)
    OR aor.lt_assoc_stage_result_id in (1, 2)
    FOR UPDATE NOWAIT;
    BEGIN
    BEGIN
    OPEN cur_aor_ids;
    LOOP
    FETCH cur_aor_ids BULK COLLECT into
    v_a_rec.associate_office_record_id, v_a_rec.week_id; --RJS. *** Bulk Load your cursor data into a buffer to do the Delete all at once.
    FORALL i IN 1..v_a_rec.associate_office_record_id.COUNT SAVE EXCEPTIONS
    INSERT INTO TEMP_ASSOC_CURRENT_WEEK_IDS
    (associate_office_record_id,week_id)
    VALUES
    (v_a_rec.associate_office_record_id(i), v_a_rec.week_id(i)); --RJS. *** Single FORALL BULK DELETE statement.
    EXIT WHEN cur_aor_ids%NOTFOUND;
    END LOOP;
    CLOSE cur_aor_ids;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR ENCOUNTERED IS SQLCODE = '|| SQLCODE ||' AND SQLERRM = ' || SQLERRM);
    dbms_output.put_line('Number of INSERT statements that
    failed: ' || SQL%BULK_EXCEPTIONS.COUNT);
    End;
    Easy right?

  • Relation between record in a form and insert statement written in button

    hi all,
    i am using Forms [32 Bit] Version 6.0.8.24.1 (Production).
    i have a master detail form with relation
    A is master of B, B is master of C and a button which resides on control block(other than A,B,C).
    so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.
    so when i try to move to next record('A' block) it is asking for database change. when i give 'yes' everything is ok. but when i give 'no'(w.r.t that record) and moves to next record and inserts the record and insert record throguh button also, at this time user press 'yes' then the first record is not saving but what ever i have inserted through the insert statement is not rolling back.
    How can i control insert statement with the respect to datablock change in the block.
    The block 'C' data is going to the other table through insert statement the block 'C' i am posting. So due to 'post' the block is not getting cleared so insert statement is also firing.
    In other words i want to unpost the posted data when user press 'no' in the database message.
    I know there is nothing to do with the forms message. But is its possible to control when user press 'no' then the insert statement should not gets saved into the table.
    Please help.
    Thanks..
    Edited by: GD on Jun 27, 2011 5:38 AM

    First off, you need to understand how Oracle Forms interacts with an Oracle database. Forms natively handles all DML transactions for you. Meaning, if you have a Forms data block based on a database table, Forms will generate all the necessary DML to handle any changes that occur in that block. You do not need to write your own DML statements in code.
    so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.Is Block "A" based on a table? How are you inserting the record into the table? If you are writting your own DML to insert the record this would explain why you are being prompted to save when you change records. As I mentioned, if your block is based on a table, Forms will know if you change a value within the block.
    How can i control insert statement with the respect to datablock change in the block.If your blocks are based on tables, let Forms handle the DML! don't do it yourself.
    In other words i want to unpost the posted data when user press 'no' in the database messageIf your block is based on a table, when you are prompted to save changes - answering 'NO' will automatically clear the current record of the data block (in essence - rollback the change).
    Craig...

  • Generate INSERT Statements question

    Is there a built-in PL/SQL procedure that SQL Developer utilizes to generate the INSERT statements when one exports data from a worksheet in 'insert' format? Is it part of the DBMS_METADATA package?
    Mike

    No this is all done in Java, we use the DBMB-METADATA only for generating DDL...

  • Question on Creating Table From Insert statement

    Hi,
    I want to create a table using a DBlink from another database using the create/insert statement. Will it also transfer the constraints or do I have to do it manually afterwards? Thanks.
    Create table T1
    SELECT a,b,c from T2 from DB@dblink;

    As discussed above, the constraints, indexes, triggers are not copied. Only NOT NULL constraints are copied.
    Look at this thread Re: Copying table structure.
    for copying triggers/indexes from source table to destination table.
    Thanks,
    Navaneeth

  • Use NEXTVAL in an insert statement Part II

    db - 10g
    I am asking this question out of curiosity.
    I posted a question and recieved a successful answer at the following address on this forum;
    Use NEXTVAL in an insert statement
    The following insert statement uses a sequence to create an arbitrary number for each null record. The problem is, the sequence is firing regardless of the condition being true or false (but it is working in that it only inserts values when the condition is true). The result is the sequence appears to increment each time it loops through the cursor and so the first arbitrary number to be inserted is not 1001 but some other higher number.
    INSERT INTO psp_trees
    ( plot_id
    , tree_name
    , species_code)
    VALUES
    ( get_plot_id
    , c1.treenum          
    , c1.species
    ) RETURNING tree_id INTO get_tree_id;   I have gotten around the issue by removing the sequence from the insert statement and placing it outside the cursor loop as an update statement.
          UPDATE psp_trees
             SET tree_name = to_char(tree_arbitrary_name_seq.nextval)
           WHERE tree_name IS NULL;Is there anyway to get the sequence to only fire in the insert statement when the condition is true.
    This is the complete anonymous block for your reference;
    DECLARE p_access_num NUMBER;
    col_access_var VARCHAR2(30);
    type number_ptb IS table OF VARCHAR2(4000);
    p_access_nam number_ptb;
    get_plot_measurement_id NUMBER;
    update_plot_measurements VARCHAR2(4000);
    get_tree_id NUMBER;
    get_plot_id NUMBER;
    BEGIN
        p_access_num := 6;
        p_access_nam := number_ptb();
        p_access_nam.extend(7);
        p_access_nam(1) := 535;
        p_access_nam(2) := 548;
        p_access_nam(3) := 898;
        p_access_nam(4) := 544;
        p_access_nam(5) := 551;
        p_access_nam(6) := 724;
        FOR loop_int IN 1 .. p_access_num
        LOOP
          col_access_var := p_access_nam(loop_int);
          -- 1. Initiate insert process by getting PK from psp_plots.
          SELECT plot_id INTO get_plot_id FROM psp_plots WHERE plot_name = col_access_var;    
          -- 2. Insert records into psp_plot_measurements and keep relationship with psp_plots with variable get_plot_id.
          --    and get primary key value of psp_plot_measurements to insert into psp_tree_measurements during loop process.
          INSERT INTO psp_plot_measurements (plot_id) VALUES (get_plot_id) RETURNING plot_measurement_id INTO get_plot_measurement_id;   
          -- 3. Update record created at point 2.
          UPDATE psp_plot_measurements
             SET measurement_date    = (SELECT DISTINCT date_ FROM pspdata)
               , codominant_height   = (SELECT DISTINCT height_codom FROM pspdata)
               , assessor            = (SELECT DISTINCT assessor FROM pspdata)
           WHERE plot_measurement_id = col_access_var
          -- 4. Open cursor to insert rows one at a time and maintain relationships between related tables.
          FOR c1 IN (SELECT treenum
                          , dbhob
                          , treecomments
                          , species
                       FROM pspdata
                      WHERE plotnumber = col_access_var
                        AND date_ IS NOT NULL)     
              LOOP   
                -- 5. Insert record into psp_trees
                --    and get primary key value of psp_trees to insert into psp_tree_measurements.
                INSERT INTO psp_trees
                ( plot_id
                , tree_name
                , species_code)
                VALUES
                ( get_plot_id
                , c1.treenum
                --, NVL(c1.treenum , to_char(tree_arbitrary_name_seq.nextval))
                --, (CASE WHEN c1.treenum IS NULL THEN to_char(tree_arbitrary_name_seq.nextval) ELSE c1.treenum END)
                , c1.species
                ) RETURNING tree_id INTO get_tree_id;   
                -- 6. Insert records into psp_tree_measurements and keep relationship with psp_trees with variable get_tree_id.
                INSERT INTO psp_tree_measurements
                ( plot_measurement_id
                , tree_id
                , dbhob          
                , comments
                VALUES
                ( get_plot_measurement_id
                , get_tree_id
                , c1.dbhob
                , c1.comment
              END LOOP;         
      END LOOP; 
          -- 7. Update null columns with arbitrary number.
          UPDATE psp_trees
             SET tree_name = to_char(tree_arbitrary_name_seq.nextval)
           WHERE tree_name IS NULL;
    END;
    /Edited by: benton on Sep 6, 2011 1:53 PM

    Or use a function (I'll use dbms_xml.getxml):
    SQL> create sequence s_seq nocache
    Sequence created.
    SQL> select case when mod (level, 2) = 0
                then extractvalue(dbms_xmlgen.getxmltype('select s_seq.nextval from dual'), '//text()')
                else '0' end col1
              from dual connect by level < 20
    COL1                                                                           
    0                                                                              
    1                                                                              
    0                                                                              
    2                                                                              
    0                                                                              
    3                                                                              
    0                                                                              
    4                                                                              
    0                                                                              
    5                                                                              
    0                                                                              
    6                                                                              
    0                                                                              
    7                                                                              
    0                                                                              
    8                                                                              
    0                                                                              
    9                                                                              
    0                                                                              
    19 rows selected.
    SQL> select sequence_name, last_number from user_sequences where sequence_name = 'S_SEQ'
    SEQUENCE_NAME                  LAST_NUMBER
    S_SEQ                                   10
    1 row selected.

  • Issu for running insert statement in oracle procedure.

    Hi expert,
    I ran a oracle procedure with a insert statement inside as:
    insert into table1 select....
    but I got error message related to this insert statement as "SQLERRM= ORA-08103: object no longer exists"
    I ran this statement separately in toad, no error message, but no data result from this execute.
    please tell how to fix this issue.
    Many Thanks,
    Edited by: 918440 on 27-Jun-2012 8:04 AM

    Hi friend,
    my insert statement is as follows:
            INSERT INTO HIROC_RU_FACT_S   
            select   
                    pp.policy_fk,  
                    pp.transaction_log_fk,  
                    p.policy_no,  
                    p.policy_type_code,   
                    hiroc_rpt_user.hiroc_get_entity_name(pp.policy_fk,'POLHOLDER')  policy_holder,  
                    pp.risk_fk,   
                    r.risk_base_record_fk,   
                    r.entity_fk,  
                    hiroc_sel_entity_risk_name2 (pp.risk_fk,r.entity_fk)  risk_name,   
                    substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2) rating_state_code,  
                    hiroc_get_province_name(substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2), 'PROVINCE_CODE', 'L') rating_state_name,  
                    hiroc_get_provicne_pol_prefix(substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2),p.policy_type_code) rating_prov_pol_prefix,   
                    nvl(r.risk_cls_used_to_rate,pth.peer_groups_code) rating_peer_group_code,  
                    hiroc_get_lookup_desc('PEER_GROUP',nvl(r.risk_cls_used_to_rate,pth.peer_groups_code),'L')  rating_peer_group_name,   
                    pth.policy_term_history_pk,   
                    pth.term_base_record_fk,   
                    to_char(pth.effective_from_date,'yyyy') term_effective_year,   
                    c.coverage_pk,   
                    c.coverage_base_record_fk,   
                    pc.coverage_code,   
                    c.product_coverage_code,   
                    pc.long_description,   
                    pp.coverage_component_code,  
                    c.effective_from_date,   
                    c.effective_to_date,  
                    cls.coverage_code coverage_class_code,   
                    cls.coverage_long_desc coverage_class_long_desc,   
                    decode(pp.coverage_component_code ,'GROSS',cls.exposure_unit,null) exposure_unit, --hiroc_get_expos_units_by_cov(c.coverage_pk,pc.coverage_code,c.effective_from_date,c.effective_to_date) exposure_unit,   
                    decode(pp.coverage_component_code ,'GROSS',cls.number_of_patient_day,null) number_of_patient_day,   
                    pth.effective_from_date  term_eff_from_date,   
                    pth.effective_to_date term_eff_to_date,    
                    pp.premium_amount premium_amount,    
                    (case when (pc.coverage_code in ('CP','MC1','MC2','MC3','MC4','HR','F') or pc.coverage_code like 'ST%') and  
                                  pp.coverage_component_code != 'RISKMGMT' then     
                            (nvl(pp.premium_amount,0))  
                        else  
                            0  
                    end) primary_premium,   
                    (hiroc_get_risk_units(hiroc_get_provicne_pol_prefix(substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2),p.policy_type_code)-- rating_prov_pol_prefix  
                                        ,nvl(r.risk_cls_used_to_rate,pth.peer_groups_code) -- rating_peer_group_code  
                                        ,cls.coverage_code --coverage_class_code  
                                        ,decode(pp.coverage_component_code ,'GROSS',cls.exposure_unit,null)  
                                        ,pp.premium_amount  
                                        ,(case when (pc.coverage_code in ('CP','MC1','MC2','MC3','MC4','HR','F') or pc.coverage_code like 'ST%') and  
                                                      pp.coverage_component_code != 'RISKMGMT' then     
                                                (nvl(pp.premium_amount,0))  
                                            else  
                                                0  
                                         end)  -- primary_premium  
                                        ,p.policy_type_code           
                                        ,trunc(pth.effective_to_date))) risk_units  
             from     proddw_mart.rmv_territory_makeup tm,  
                      proddw_mart.rmv_premium_class_makeup pcm,  
                      proddw_mart.rmv_product_coverage pc,  
                      proddw_mart.rmv_coverage c,  
                      proddw_mart.rmv_risk r,  
                      proddw_mart.rmv_policy_term_history pth,  
                      proddw_mart.rmv_policy p,  
                      proddw_mart.rmv_transaction_log tl,  
                      proddw_mart.rmv_policy_premium pp,  
                      (select  /* +rule */  
                               p.policy_no,  
                               p.policy_start_date,  
                               p.policy_end_date,   
                               r.risk_pk,  
                               r.risk_description,  
                               c.coverage_pk,  
                               c.parent_coverage_base_record_fk,  
                               pc.parent_product_covg_code,  
                               pc.coverage_code,  
                               pc.short_description coverage_short_desc,   
                               pc.long_description coverage_long_desc,  
                               c.exposure_unit,  
                               pc.exposure_basis_code,  
                               c.number_of_patient_day,  
                               p.policy_start_date policy_effective_date,  
                               p.policy_end_date policy_expiry_date,  
                               c.effective_from_date,  
                               c.effective_to_date,  
                               to_char(c.effective_from_date,'YYYY') class_eff_year  
                        from   proddw_mart.odwr_coverage_only      c  
                              ,proddw_mart.odwr_product_coverage   pc  
                              ,proddw_mart.odwr_risk               r  
                              ,proddw_mart.odwr_policy             p  
                        where  pc.code                 = c.product_coverage_code  
                          and  pc.parent_product_covg_code is not null                 -- coverage classes only  
                          and  r.risk_pk = c.risk_base_record_fk  
                          and  c.accounting_to_date = to_date('1/1/3000','mm/dd/yyyy') -- only open records  
                          and  c.base_record_b = 'N'  
                          and  p.base_record_b = 'N'  
                          and  p.policy_pk = r.policy_fk  
                          and  p.accounting_to_date = to_date('1/1/3000','mm/dd/yyyy')  -- only open records  
                       group by p.policy_no,  
                               p.policy_start_date,  
                               p.policy_end_date,   
                               r.risk_pk,  
                               r.risk_description,  
                               c.coverage_pk,  
                               c.parent_coverage_base_record_fk,  
                               pc.parent_product_covg_code,  
                               pc.coverage_code,  
                               pc.short_description, -- coverage_short_desc,   
                               pc.long_description, -- coverage_long_desc,  
                               c.exposure_unit,  
                               pc.exposure_basis_code,  
                               c.number_of_patient_day,  
                               p.policy_start_date, -- policy_effective_date,  
                               p.policy_end_date, -- policy_expiry_date,  
                               c.effective_from_date,  
                               c.effective_to_date,  
                               to_char(c.effective_from_date,'YYYY')-- class_eff_year  
                      ) cls  
                where    tm.risk_type_code = r.risk_type_code  
                and        tm.county_code = r.county_code_used_to_rate  
                and        tm.effective_from_date <= pp.rate_period_from_date  
                and        tm.effective_to_date   >  pp.rate_period_from_date  
                and        pcm.practice_state_code (+) = r.practice_state_code  
                and        pcm.risk_class_code (+) = r.risk_cls_used_to_rate  
                and        nvl(pcm.effective_from_date, pp.rate_period_from_date) <= pp.rate_period_from_date  
                and        nvl(pcm.effective_to_date, to_date('01/01/3000','mm/dd/yyyy')) > pp.rate_period_from_date  
                and        pc.code = c.product_coverage_code  
                and        c.base_record_b = 'N'  
                and        ( c.record_mode_code = 'OFFICIAL'  
                         and (c.closing_trans_log_fk is null or  
                              c.closing_trans_log_fk != tl.transaction_log_pk)  
                         or c.record_mode_code = 'TEMP'  
                         and c.transaction_log_fk = tl.transaction_log_pk )  
                and   c.parent_coverage_base_record_fk is null  
                and        c.effective_from_date  <  c.effective_to_date  
                and        c.effective_from_date  <= pp.rate_period_from_date  
                and        c.effective_to_date    >  pp.rate_period_from_date  
                and   c.accounting_from_date <= tl.accounting_date  
                and   c.accounting_to_date   >  tl.accounting_date  
                and        c.coverage_base_record_fk=pp.coverage_fk  
                and        r.base_record_b = 'N'  
                and        ( r.record_mode_code = 'OFFICIAL'  
                        and (r.closing_trans_log_fk is null or  
                             r.closing_trans_log_fk != tl.transaction_log_pk)  
                        or r.record_mode_code = 'TEMP'  
                        and r.transaction_log_fk = tl.transaction_log_pk )  
                and        r.effective_from_date  <  r.effective_to_date  
                and        r.effective_from_date  <= pp.rate_period_from_date  
                and        r.effective_to_date    >  pp.rate_period_from_date  
                and   r.accounting_from_date <= tl.accounting_date  
                and   r.accounting_to_date   >  tl.accounting_date  
                and         r.risk_base_record_fk = pp.risk_fk  
                and        pth.base_record_b = 'N'  
                and        ( pth.record_mode_code = 'OFFICIAL'  
                        and (pth.closing_trans_log_fk is null or  
                             pth.closing_trans_log_fk != tl.transaction_log_pk)  
                        or pth.record_mode_code = 'TEMP'  
                        and pth.transaction_log_fk = tl.transaction_log_pk )  
                and        pth.accounting_from_date <= tl.accounting_date  
                and        pth.accounting_to_date   >  tl.accounting_date  
                and        pth.term_base_record_fk = pp.policy_term_fk  
                and   p.policy_pk = pp.policy_fk  
                and        tl.transaction_log_pk  =  pp.transaction_log_fk  
                and   pp.active_premium_b = 'Y'  
                and        pp.rate_period_type_code in ('CS_PERIOD','SR_PERIOD')  
                and        pp.rate_period_to_date > pp.rate_period_from_date  
                and tl.accounting_date <= sysdate   
                and p.policy_cycle_code = 'POLICY'  
                and substr(p.policy_no,1,1) <> 'Q'  
                and tl.transaction_log_pk = (select max(pp.transaction_log_fk)  
                                               from proddw_mart.rmv_policy_premium pp,proddw_mart.rmv_transaction_log tl2  
                                              where pth.term_base_record_fk = pp.policy_term_fk  
                                                and pp.transaction_log_fk = tl2.transaction_log_pk  
                                                and tl2.accounting_date <= sysdate )    
                 and p.policy_type_code in ('LIABCRIME','MIDWIFE')    
                 and pth.accounting_to_date =  to_date('01/01/3000','mm/dd/yyyy') --<<<*******  eliminates duplicates  
                 and p.policy_no = cls.policy_no  
            --     and r.risk_pk = cls.risk_pk  
                 and c.coverage_base_record_fk = cls.parent_coverage_base_record_fk(+)  
                 and  cls.effective_from_date < pth.effective_to_date -- from date less than period end date  
                 and  cls.effective_to_date   > pth.effective_from_date -- to date greater than period start date  
                 and  cls.policy_effective_date   < pth.effective_to_date -- from date less than period end date  
                 and  cls.policy_expiry_date     > pth.effective_from_date -- to date greater than period start date  
           group by pp.policy_fk,  
                    pp.transaction_log_fk,  
                    p.policy_no,  
                    p.policy_type_code,   
                    pp.risk_fk,   
                    r.risk_base_record_fk,   
                    r.entity_fk,  
                    substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2), -- rating_state_code,  
                    r.county_code_used_to_rate,  
                    pth.issue_state_code,  
                    nvl(r.risk_cls_used_to_rate,pth.peer_groups_code) , --  rating_peer_group_code,  
                    r.risk_cls_used_to_rate,  
                    pth.peer_groups_code,  
                    pth.policy_term_history_pk,   
                    pth.term_base_record_fk,   
                    to_char(pth.effective_from_date,'yyyy'), --term_effective_year,   
                    c.coverage_pk,   
                    c.coverage_base_record_fk,   
                    pc.coverage_code,   
                    c.product_coverage_code,   
                    pc.long_description,   
                    pp.coverage_component_code,  
                    c.effective_from_date,   
                    c.effective_to_date,  
                    cls.coverage_code, -- coverage_class_code,   
                    cls.coverage_long_desc, -- coverage_class_long_desc,   
                    decode(pp.coverage_component_code ,'GROSS',cls.exposure_unit,null),-- exposure_unit,   
                    decode(pp.coverage_component_code ,'GROSS',cls.number_of_patient_day,null), -- number_of_patient_day,   
                    pth.effective_from_date, --term_eff_from_date,   
                    pth.effective_to_date, --, --term_eff_to_date,    
                    pp.premium_amount ;Edited by: BluShadow on 27-Jun-2012 16:12
    added {noformat}{noformat} tags for readability.  PLEASE READ {message:id=9360002} AS PREVIOUSLY REQUESTED!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           &

  • Running .sql file or insert statements

    I have a large .sql file compiled from SQL developer from a SQL Server database. Whatever I do, I cannot get the rows to be permanently committed to the oracle db. I tried copying the text directly from the file and running it as a script on the Oracle server which seemed to work but the rows did not actually commit, they weren't available in the program and when I restarted the SQL Developer program they disappeared.
    I also tried using SQL Plus and received the same results. I even tried copying just a single insert statement in with no success.
    A second problem I have is when copying the entire file over, somewhere around line 500 it starts asking for substation variables, which I have no idea what they are or why it's asking for them.
    Thanks for any help :)

    Daft question, but have you got "commit" in your script?
    Also, you'll need to "set define off" at the beginning of your script - & is the default prompt for SQLPLUS to ask for a variable, so if you're trying to insert "You & Me", it'll prompt you for a value for Me, unless you've got set define off.

  • Select query and Insert statement performance

    Hi all,
    Can anyone plz guide us on below problem I am facing ?
    1) One of the simple Insert statement runs very slow..What might be the reason? Its simple table without any LOBs ,LONG or so. Everything else in the DB works fine.
    2) one of the SELECT statement runs very slow. It selects all records (around 1000) from a table..How can i improve its performance?
    3)Which columns in the Master and its detail tables should be indexed to improve Query performance on them.
    Many Thanks
    Regards
    sandeep

    To get an answer to your questions you have to post some informations about your system:
    1. operating system
    2. RAM
    3. oracle version
    4. init.ora
    Thomas

  • Concurrency wait on an insert statement

    Hello All,
    I am running Oracle RAC 2 nodes 11g R2 on AIX 7.1
    I have a table with unique index, and the application is doing inserts/updates into this table.
    Suddenly and for about half a minute I faced a high concurrency waits on all the processes running these inserts for one node. I saw this high concurrency wait in the top activity screen of the OEM only on one of the nodes. knowing that the processes doing these inserts are running on both nodes.
    All what I have that in this half minute I see high concurrency wait in OEM top activity screen related to this insert statement and when I clicked on the insert I found high "enq: TX - index contention". Again this was only on one node.
    After this half minute everything went back to normal.
    What could be the reason and how can I investigate it ?
    Regards,

    Neo-b wrote:
    Hello All,
    I am running Oracle RAC 2 nodes 11g R2 on AIX 7.1
    I have a table with unique index, and the application is doing inserts/updates into this table.
    Suddenly and for about half a minute I faced a high concurrency waits on all the processes running these inserts for one node. I saw this high concurrency wait in the top activity screen of the OEM only on one of the nodes. knowing that the processes doing these inserts are running on both nodes.
    All what I have that in this half minute I see high concurrency wait in OEM top activity screen related to this insert statement and when I clicked on the insert I found high "enq: TX - index contention". Again this was only on one node.
    After this half minute everything went back to normal.
    What could be the reason and how can I investigate it ?
    Regards,I bet that the INDEX contains a SEQUENCE.

  • Basic Questions related EHPs for SEM

    Hi Guys,
    I've some basic questions related to EHPs: -
    1. If we don't mean to implement any of the new functionalities does it make any sense to implement EHP? In other words do EHPs also have some general improments other than the functionalities which can be specifically activated?
    2. If we just activate a functionality and don't implement/ use it can there be any negative impact?
    3. In case of a pure technical upgrade from SEM 4.0 to SEM 6.0 which EHP would be recommended?
    4. Is there a quick way to find all relevant notes in EHPn which are related to corrections for EHPn-1?
    Thanks in advance,
    -SSC

    HI,
    If you see some of my older posts I have had many issues with certain features of the EHP2 functionality but that doesn't mean I would recommned against it.
    BCS 6 EHPs 3 & 4  (BCS 6.03 / 6.04) - enhancement packs worth implementing?
    BCS 6 EHP 2 (BCS 6.02) - activation of enhancement pack
    My recommendation is to implement the EHPs but not necesarrily activate the functions (in SFW5) unless you need them - this means that you will only have to test once after EHP implementation and will have the ability to activate the other features as and when required (although testing is required after activation of course) whereas it might be difficult to persuade your client/basis team to implement EHP4 later if you don't do it now.
    In the features of EHP2 (activate FIN_ACC_GROUP_CLOSE) it states that there is a general performance improvement - although I have yet to experience it! From OSS note 1171344 "The functionality which is available in EHP2 consists of...
    ... Performance improvements of status management, reporting and initial start-up of consolidation workbench and monitor.
    Since activating FIN_ACC_GROUP_CLOSE I have had many OSS notes requiring application but i discovered that when the technical team implemented the EHPs (before i joined this client) they somehow forgot the latest SP (support packs) and didn't upgrade to the current level - so make sure that you get the right SPs too (see the links in Greg's link above) to avoid the many OSS notes.
    As for your question - "is there a list of OSS notes to specific to EHP upgrades? - the answer is most definietly "NO" - I already asked OSS in desperation!
    however, you can see the OSS notes that i have applied listed in the above link ( BCS 6 EHP 2 (BCS 6.02) - activation of enhancement pack )

  • INSERT Statement behind a FORM on a TABLE with REPORT

    When I create a form on a table with report, I'm sure an INSERT STATEMENT is genereated in the background somewhere. How can I see this insert statement or how can I get to this INSERT statement? If I can see it, would I be able to modify this INSERT statement?
    Please use simple terms.
    Thanks.

    Roel
    At first, i was just curious to see where that insert statement is and how it looks like.
    Later, I really wanted to see it because I wanted to know how it looks like whne I try to insert a one to many relationship record. Don't know if I'm being too clear on this.
    Lets say table A and B have a 1-to-many relationship. When I want to insert records into both A and B, how does the insert work? Maybe if I get an answer to this question, I may understand how the inserts are done on a 1 to many relationship data insert.
    Thanks.

  • Export to INSERT STATEMENT Possible Bug

    h2. Synopsis
    Currently, if your table has nested tables using Types, the export to INSERT STATEMENT does correctly create the insert statement. In the sample below, the PURGE_WHERE_CLAUSE is a nested table (TYPE and TABLE of TYPE)
    h2. Examples
    h4. Below is an example of the incorrectly created insert statement made by SQL Developer.
    INSERT
    INTO PRG_DTLS
    PRG_NAME,
    TABLE_ID,
    FILE_ID,
    PRG_ORDER_SEQ_NO,
    PRG_ACTION_ID,
    OPERATING_SYSTEMS_ID,
    PRG_WHERE_CLAUSE,
    CREATED_BY,
    CREATED_DATE,
    LAST_UPDATED_BY,
    LAST_UPDATED_DATE
    VALUES
    'GUITEST01',
    26,
    NULL,
    1,4,
    NULL,
    *'STGMGR.PRG_CRITERIA(STGMGR.PRG_CRITERIA(PRCS_ID,=,1,null,null,null))',*
    'XXXXXXX',
    to_date('21-MAY-09','DD-MON-RR'),
    'XXXXXXX',
    to_date('21-MAY-09','DD-MON-RR')
    h4. Below is a sample of how it should correctly be made
    INSERT
    INTO STGMGR.PRG_DTLS
    PRG_NAME,
    TABLE_ID,
    PRG_ORDER_SEQ_NO,
    PRG_ACTION_ID,
    PRG_WHERE_CLAUSE,
    CREATED_BY,
    CREATED_DATE,
    LAST_UPDATED_BY,
    LAST_UPDATED_DATE
    VALUES
    'GUITEST01',
    26,
    1,
    4,
    *"STGMGR"."PRG_CRITERIA_NT"( "STGMGR".PRG_CRITERIA('PRCS_ID','=','1',NULL,NULL,NULL)),*
    'XXXXXXXX',
    TO_DATE('05/21/2009 15:45:18', 'MM/DD/YYYY HH24:MI:SS'),
    'XXXXXXX',
    TO_DATE('05/21/2009 15:45:18', 'MM/DD/YYYY HH24:MI:SS')
    COMMIT;
    h2. Is there a workaround or fix?
    I've attempted to see if I can find a fix for this in some type of settings in the preference but I have not yet found anything. Has anyone found a fix for this issue?

    Hi Barry,
    It is a Type and Table of types stored as a nested table in a regular table.
    Its basically a tool we created to store the WHERE clauses for an automated tool that will delete old data that we no longer need from our database.
    So, it dynamically stores and creates the DELETE statements.
    Hope this answers your question Barry.
    Thanks.

  • Question related to Synchronous update

    Hi, all
    I have some question related to synchronous update:
    1. What is the syntax if I want to write synchronous update.
    Do i write as:
    call funcition A in update task
    commit work and wait
    Or just
    call function  A (A declared as update type function )
    commit work and wait
    Or ...
    2.If we use synchronous update, is VBHDR,VBDATA still filled the same way when using asynchronus update?
    Thanks in advance,
    Liming

    Hi,
    Why do we use this " In Update Task " ??
    The main update technique for bundling database changes in a single
    database LUW is to use CALL FUNCTION... IN UPDATE TASK.
    How do we Use ??
    A typical R/3 installation contains dialog work processes and at least one update work process. The update work processes are responsible for updating the database. When an ABAP program reaches a COMMIT WORK statement, any function modules from CALL FUNCTION... IN UPDATE TASK statements are released for processing in an update work process. The dialog process does not wait for the update to finish. This kind of update is called asynchronous update.
    What is the Use... ??
    Asynchronous update is useful when response time from the transaction is critical, and the database updates themselves are so complex that they justify the extra system load

  • Cfloop and insert statement

    I have a form that lists property addresses. For each address
    you want to post a payment for, you select the checkbox next to the
    address (value=property_id), you fill out the form filed for Amount
    Paid (value=paid_num) and you can put something in the notes form
    field as well(value=notes_txt)
    I also have single form fields that relate to all properties:
    month (month_id), year (year_id), pay date (paid_dt).
    My action page uses a cfloop using property_id. I need to
    insert a payment record for each property address that was selected
    using the data in the formfields. After the payment record is
    inserted, then I need to update the property's balance to reflect
    the new payment. ex: a property's new balance would be current
    balance - payment amount
    The loop seems to be working properly, but... if I have more
    than one property selected, it's trying to insert all the payment
    amounts (paid_num) for a single address (so i get error saying the
    number of values in the form don't match up agains the insert
    statement.). I hope this is clear - see my attached code.
    If anyone can figure out what I'm doing wrong I would really
    appreciate it.

    Thanks web-spinner. I tried your first bit since i don't want
    to insert a payment record if no payment is made... but I got this
    error. I believe it's having a problem with this bit of code in the
    INSERT statement
    #evaluate(form.paid_num#ListElement#)#
    see error message below...

Maybe you are looking for

  • How do I fix bad Quality audio recording in Captivate 4

    I am having trouble recording decent quality audio in Captivate 4. What is happening is after I do the screen and audio recording when I play it back the audio is choppy. It also kind of sounds like the audio is quickly echoed and then clipped. Final

  • Saving PDFs that others can save

    Good morning, I have the full version of Acrobat (Pro) on my mac. I created some forms that are edited by another employee in the full version of Acrobat (Pro) on her PC. These forms are then posted to our company's intranet for others to fill out an

  • Mail reduces my pictures and attachments automatically

    If I write or transmit mails with pictures attached (even if they are attached by Iphoto), mail reduces my Pictures automatically. How can I send pictures in original size?

  • Creating Cost Elements for OBYC Accounts

    Hi We are implementing COPA and we have manufacturing scenario (MTS) also. Now i have created cost elements (with category as 1). Now its giving me error for CO object when i post any SD entry (at the time of PGI and releasing billing document to acc

  • How to add external images onto a control and still be able to resize

    Hello, I'm a LabVIEW newbie.  I'm trying to customize the appearance of my VIs, and one of the things I like to do is to import external image and paste it onto the faceplate of the gauge indicator.  I've followed the instruction in the Labview appli