Insert records from datablock

Hello Friends
I have a datablock in tabular form
now i want to put a few fields of multiple records to another table, But it should work while inserting,updating and deletion as well,
I need complete procedure
thanks to all;

You have to use Post-Insert, Post-Update and Post-Delete triggers in your tabular datablock.
For every new element, new change and deletion you can update consequently your data in the other table.
I won't give you the complete procedure.
Bye,
ROb

Similar Messages

  • Inserting records from internal table to database table

    Hi all,
    i want to insert records from internal table to zDatabase table, can u plz guide me which statement is better in performance to insert the records.
    1) insert one by one record from internal table
    loop at itab.
    insert ztable from wa.
    endloop.
    2) insert total records at a time
    INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or let me know if any other statement is there with high performance.
    i internal table contains nearly 40000 records.
    thanks.

    Hi,
    Insert the entire table at atime rather than a record so as to increase the performance.
    you can use INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or
    MODIFY ZPRODUCT FROM TABLE GI_AFPO.
    Regards,
    Raj.

  • Insert records from report program into R3 table

    Hi
    I wanted to insert records from report program into R3 table.
    here is my code
    data : itab type standard table of zemp initial size 10 with header line.
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    but i am getting the following error
    the type of the data base table and work area/internal table "ITAB" are no unicode-converible.
    how can I insert records from report program into R3 table
    should I have to write move corresponding
    pls guide
    thanks
    manian

    Hi,
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    Do one thing
    Data : itab type table of ztable with header line.
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    error will resolve, then try to make structure similar to ZTABLE

  • Retrive last inserted  record  from database table

    Hi,
    some body inserting a record into table 'A' through some procedure/java program.i want to retrive the last inserted record from database table.records are not stored in order.Can any body help me.

    In general, unless you are storing a timestamp as part of the row or you have some sort of auditing in place, Oracle has no idea what the "first" or "last" record in a table is. Nor does it track when a row was inserted.
    - If you have the archived logs from the point in time when the row was inserted, you could use LogMiner to find the timestamp
    - If the insert happened recently (i.e. within hours), you may be able to use flashback query to get the value
    - If you're on 10g or later and the table was built with ROWDEPENDENCIES and the insert happened in the last few days and you can deal with a granularity of a few seconds and you don't need 100% accuracy, you could get the ORA_ROWSCN of the row and convert that to a timestamp.
    If this is something you contemplate needing, you need to store the data in the row or set up some sort of auditing.
    Justin

  • Insert record from one table to another with help of cursor

    Plz help!!!
    tables are - 1. country( country_id pk, country_name, region_id)
    2. a( country_id , country_name, region_id)
    table a data are
    1 a 1
    2 b 2
    3 c 3
    null d 4
    5 e 5
    6 f 6
    7 g 7
    insert record from table a to country table with help of cursor, insert all not null records.
    this procedure does not give correct result
    create or replace
    procedure amit as
    cursor c1 is select * from a;
    rw a%rowtype;
    begin
    open c1;
    fetch c1 into rw;
    while(c1%found)
    loop
    insert into countries values(rw.country_id,rw.country_name,rw.region_id);
    commit;
    fetch c1 into rw;
    if rw.country_id is null then
    fetch c1 into rw;
    end if;
    end loop;
    close c1;
    exception
    when others then
    dbms_output.put_line('exception name= '||rw.country_name);
    end;

    bluefrog wrote:
    You don't need cursor at all;
    create or replace procedure amit as
    begin
    insert into countries (Country_ID, Country_Name, Region_ID)
    (select a.Country_ID
    ,a.Country_Name
    ,a.Region_ID
    from a
    dbms_output.put_line('Rows inserted : ' || sql%rowcount);
    commit;
    end;
    Bluefrog you missed where clause. :)
       insert into countries (Country_ID, Country_Name, Region_ID)
       (select a.Country_ID
              ,a.Country_Name
              ,a.Region_ID
        from a
        where country_id is not null
    );

  • Inserting records from a txt file to a database table

    I would like to know how to insert records from a file (txt) to a database table through a java application?

    [BufferedReader |http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html] and PreparedStatement
    IO and JDBC

  • Insert records from one table to other table

    Hi,
    I want to insert all the records from table 1 which are not in table 2 into table2
    o/p
    insert into table2
    select * from table1
    where a.id!=b.id;
    Please let me know is there any way that I can populate the records

    insert
      into table2
      select  *
        from  table1
        where id not in (
                         select  id
                           from  table2
                        );SY.

  • Inserting records from Infopath forms library to a SQL table

    Hi,
    I have a requirement where i need to populate records from a Infopath forms library to a SQL table in a database. We have written a console app to achive the same. However we are encountering performance issues when inserting records in the database. The
    way we retreive information from Infopath forms library is through a CAML query and then insert record by record in database. Is their a better and faster way to acheive this?
    Can someone pls help? 
    thanks,
    Anand
    Thanks and Regards, Anand R. Deshpande

    Hello Anand,
    Could you share you console application code? Also tell us when you face performance issue. I mean is there any problem in accessing infopath form or you are facing problem with only console application.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Update/Insert records from Oracle to MySQL

    Hi team, 
    My application will insert/update records into Oracle database, I need to sync all of records into MySQL database.  I designed a package to load data from Oracle to MySQL, the Oracle database use OLE DB component and MySQL database use ADO.NET.
    How to insert new records into MySQL? If the old record exists, we also need to replace with new record. I did some research, someone suggest to create a stage table to handle this scenario, but I have 14 tables in this case. How to handle this scenario
    with high performance? 
    If there is anything unclear, please let me know. 
    Thank you in advance. 

    Finally, I created 14 tables as same as in our MySQL database system with prefix "updated" , they are use to store the updated records from Oracle system. All of new records we add a flag, the "1" means insert a new record into the system,
    and the "0" means we should updated. So, I can use the conditional split component to split all of new records. The new records insert into the target table and the updated records insert into the "updated_table". Finally, we can add a
    SQL Script task to run a update script to sync all of records. 
    I don't use Lookup Transformation because we must use Cache
    Transform transformation in this case, the Cache connection manager to save the data to a cache file (.caw), it will hard to
    trace the history data in the future.  
    In addition, I recommend to use ODBC connection if somebody face the similar scenario with me, there is a bug  if we use ADO.NET to
    load data from Oracle to MySQL by using SSIS. For more information, please refer the MSDN document: http://blogs.msdn.com/b/mattm/archive/2009/01/07/writing-to-a-mysql-database-from-ssis.aspx
    @Arthur, thanks again for your input.  Have a nice day! :)

  • Performance issue - insert records from db2 tables

    I have a table say emp in oracle database and i have the emp table in db2 database. My job is to pull all the records (million records) from db2 table to oracle emp table. My insert statement is like below. I am connecting to the db2 database using dblink.
    insert into emp
    select * from emp_db2, dept_db2
    where emp_db2.dno = dept_db2.dno
    and dept_db2.dno = 10;
    The statement is still running. How to improve the performance ?
    please suggest.
    thanks,
    Vinodh

    Vinodh2 wrote:
    1.how much is your select query is taking? 1 day over . still running.
    2.What is the row count from the query? 85632978 records
    3.Whats your expected completion time? 30 minutes
    I am not getting the explain plan because the query is still running.
    do as below
    SQL> set autotrace traceonly explain
    SQL> select sysdate from dual;
    Execution Plan
    Plan hash value: 1388734953
    | Id  | Operation      | Name | Rows     | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |     |     1 |     2   (0)| 00:00:01 |
    |   1 |  FAST DUAL      |     |     1 |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------

  • How to get the last inserted record from a table ?

    :-) Hiee E'body
    I work on Oracle 8i and need to get the last
    record inserted in a table.
    I have tried using rownum and rowid pseudo-columns
    but that doesn't work.
    Can you please help me out ?
    :-) Have a nice time
    Vivek Kapoor.
    IT, Atul Ltd.,
    India.

    I'm not sure about 8i features.
    I assume here that you don't have 'Date-Time' stamp columns on the table which is the easiest way to determine the last inserted row in the table.
    If not try the following :-
    select address, piece, SQL_TEXT
    from V$SQLTEXT
    where upper(sql_text) like '%INSERT INTO TABLE_NAME%'
    Substiute the TABLE_NAME with the name of the actual table.
    Have fun.
    Regards,
    Shailender
    :-) Hiee E'body
    I work on Oracle 8i and need to get the last
    record inserted in a table.
    I have tried using rownum and rowid pseudo-columns
    but that doesn't work.
    Can you please help me out ?
    :-) Have a nice time
    Vivek Kapoor.
    IT, Atul Ltd.,
    India.

  • Insert records from a single table to two related tables

    DB - 10G
    OS - XP
    We have many thousands of comma delimited records that we want to insert into a normalised table structure.
    I have created a test dataset that can be found at the end of this post.
    I have csv records that look like this;
    donald, huey
    donald, dewey
    donald, louie
    And I want the data to be inserted into two separate table like this;
    table named PARENTS
    pk parent_name
    1  donald
    Table named CHILDRENS
    pk fk child_name
    1  1 huey
    1  2 dewey
    1  3 louie
    I constructed an insert statement that looks like this;
    INSERT ALL
      INTO parents (parent_id, parent_name) VALUES (parents_seq.nextval, parent_name)
      INTO children (children_id, parent_id, child_name) VALUES(children_seq.nextval, parents_seq.nextval, child_name )
    SELECT parent_name, child_name
      FROM sources;
    And this resulted in the following;
    Table named PARENTS
    pk child_name
    1  DONALD
    2  DONALD
    3  DONALD
    Table named PARENTS
    pk fk child_name
    1  1  HUEY
    2  2  DEWEY
    3  3  LOUIE
    Would anyone have any ideas on how I could accomplish this task?
    This is some example data;
    [code]
    DROP SEQUENCE parents_seq;
    DROP SEQUENCE sources_seq;
    DROP SEQUENCE children_seq;
    DROP TABLE sources;
    DROP TABLE children;
    DROP TABLE parents;
    CREATE SEQUENCE PARENTS_SEQ MINVALUE 1 MAXVALUE 1000000000000000000000000000 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE;
    CREATE TABLE PARENTS
    ( PARENT_ID      NUMBER(8) NOT NULL
    , PARENT_NAME    VARCHAR2 (50 CHAR) NOT NULL
    , CONSTRAINT     PARENTS_PK PRIMARY KEY (PARENT_ID)
    create or replace
    TRIGGER PARENTS_BI
    BEFORE
      INSERT OR UPDATE ON PARENTS
      FOR EACH ROW BEGIN
      IF INSERTING THEN
        IF :NEW.PARENT_ID IS NULL THEN
          SELECT PARENTS_SEQ.nextval INTO :NEW.PARENT_ID FROM dual;
        END IF;
      END IF;
    END;
    CREATE SEQUENCE SOURCES_SEQ MINVALUE 1 MAXVALUE 1000000000000000000000000000 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE;
    CREATE TABLE SOURCES
    ( SOURCE_ID      NUMBER(8) NOT NULL
    , PARENT_NAME    VARCHAR2 (50 CHAR) NOT NULL
    , CHILD_NAME    VARCHAR2 (50 CHAR) NOT NULL
    , CONSTRAINT     SOURCES_PK PRIMARY KEY (SOURCE_ID)
    create or replace
    TRIGGER SOURCES_BI
    BEFORE
      INSERT OR UPDATE ON SOURCES
      FOR EACH ROW BEGIN
      IF INSERTING THEN
        IF :NEW.SOURCE_ID IS NULL THEN
          SELECT SOURCES_SEQ.nextval INTO :NEW.SOURCE_ID FROM dual;
        END IF;
      END IF;
    END;
    INSERT INTO SOURCES (PARENT_NAME, CHILD_NAME) VALUES ('DONALD', 'HUEY');
    INSERT INTO SOURCES (PARENT_NAME, CHILD_NAME) VALUES ('DONALD', 'DEWEY');
    INSERT INTO SOURCES (PARENT_NAME, CHILD_NAME) VALUES ('DONALD', 'LOUIE');
    Commit;
    CREATE SEQUENCE CHILDREN_SEQ MINVALUE 1 MAXVALUE 1000000000000000000000000000 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE;
    PROMPT *** CREATE TABLE ***
    CREATE TABLE CHILDREN
    ( CHILDREN_ID    NUMBER NOT NULL
    , PARENT_ID      NUMBER NOT NULL
    , CHILD_NAME     VARCHAR2 (50 CHAR) NOT NULL
    , CONSTRAINT     CHILDREN_PK PRIMARY KEY (CHILDREN_ID)
    create or replace
    TRIGGER CHILDREN_BI
    BEFORE
      INSERT OR UPDATE ON CHILDREN
      FOR EACH ROW BEGIN
      IF INSERTING THEN
        IF :NEW.CHILDREN_ID IS NULL THEN
          SELECT CHILDREN_SEQ.nextval INTO :NEW.CHILDREN_ID FROM dual;
        END IF;
      END IF;
    END;
    [code]

    Looks like this is one way of achieving it:
    insert into parents (parent_name) select distinct parent_name from sources;
    select *
      from parents;
    PARENT_ID              PARENT_NAME                                       
    1                      DONALD
    insert into children (parent_id, child_name)
    select p.parent_id, s.child_name
      from sources s
      join parents p
        on (s.parent_name = p.parent_name);
    select *
      from children;
    CHILDREN_ID            PARENT_ID              CHILD_NAME                                        
    1                      1                      HUEY                                              
    2                      1                      DEWEY                                             
    3                      1                      LOUIE

  • Insert records from user form to multiple tables in same database

    Hi Experts, I need your help. I have a form that has multiple text fields that I need to insert the records to their each respective table. For example: The first name field needs to go the the name table, address goes to a seperate table, phone goes to a seperate table and so on.
    Is this possible to do?
    Thanks Much
    Sham

    The same for ASP, JSP or PHP.  Just the code syntax is different for each language.  Are you using MySQL, Access or ?
    In any case, create the three recordsets on the database and use insert queries.  If you don't know what one is, google insert query and you will see the syntax. 
    Here is a good example out on the web
    http://www.stardeveloper.com/articles/display.html?article=2000032601&page=1
    In your case you would get the values for the inserts from the form data and only need to open the database connection once.
    Good luck.
    Walt
    B & B Photography

  • Create Trigger to insert records from one table to another

    I created the below trigger to move data from one table to another after records have been inserted from another table to that table. What I need done is that each time records have been inserted into TEST_TBL, one of these actions codes should be implimented: U-update, N-insert, D-delete and inserted into TEST_TBL1. But each time I run the script, I get bunch of errors. Please see the script below: - Your help will be appreciated.
    create or replace
    trigger POWER_tr
    after update or insert or delete ON test_tbl
    for each row
    begin
    if updating then
    insert into test_tbl1
    (idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, action_code, date_added
    VALUES
    (idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, 'U', sysdate);
    ELSif INSERTING then
    insert insert into test_tbl1
    (idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, action_code, date_added
    VALUES
    (idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, 'N', sysdate);
    ELSIF deleting then
    insert into test_tbl1
    (idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, action_code, date_added
    VALUES
    (idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, 'D', sysdate);
    END IF;
    END POWER_tr;
    Thank you,
    Albert Zaza
    Edited by: azaza on Mar 1, 2009 4:14 PM

    Hello
    At the end of trigger show errors / and post what errors are you getting exactly?
    Here is a simple example for your reference, this will save old values in history table; you can replace it with new values if that's what do you want.
    CREATE OR REPLACE TRIGGER TRG_DU
       AFTER DELETE OR UPDATE
       ON EMPLOYEE    REFERENCING NEW AS New OLD AS Old
       FOR EACH ROW
    DECLARE
    BEGIN
       IF UPDATING
       THEN
          INSERT INTO employee_hist
            VALUES   ('UPDATE',
                      :OLD.empid,
                      :OLD.name,
                      :OLD.deptid);
       ELSIF DELETING
       THEN
          INSERT INTO employee_hist
            VALUES   ('UPDATE',
                      :OLD.empid,
                      :OLD.name,
                      :OLD.deptid);
       END IF;
    EXCEPTION
       WHEN OTHERS
       THEN
          -- Consider logging the error and then re-raise
          RAISE;
    END TRG_DU;
    /Regards
    Edited by: OrionNet on Mar 1, 2009 7:27 PM

  • How to insert records from form to database?

    Hi all, i manage to make a connection from my form in adobe designer 7
    to my database Oracle 9i, now i want to add some buttons to the form
    and navigate, delete or add data from my form to the database, anyone
    has ideas to accomplish this?, i made a button and use this code
    "xfa.sourceSet.dataConnectionName.addNew();" without the "", but in the
    debugger this message appears:
    "TypeError: xfa.sourceSet.dataConnectionName has no properties
    1:XFA:form1[0].hola[0].Button1[0]:click"
    hope someone can help me with this problem, thanks in advance.
    regards
    Alex

    Alex alatorre do you speak spanish? can you help me?
    I have de same problem
    want to add data from my form to the database, i made a button and use this code xfa.sourceSet.prueba.addNew();
    but in the debugger this message appears:
    TypeError: xfa.sourceSet.prueba has no properties
    1:XFA:form1[0].#subform[0].Button1[0]:click
    My data connection is with microsoft access (local mode). When i configure the data connection i make the test and it says test succes, but...
    how do i know if the connection is really made when i open my form in acrobat? I only need to do new data conection in designer and create de button or a need to configure something else?
    When i create the button ... i only need copy in the javascript window...
    xfa.sourceSet.prueba.addNew();
    or do i need something else?
    I am a newbie with this... and sorry about my english.
    hope someone can help me with this problem, thanks in advance

Maybe you are looking for

  • My Imac is very slow, in paticular Chrome browser. Can anyone help me identify cause? Thank you

    Problem description: I have a very slow imac. In particular chrome browser is slow. Programs such as microsoft office and itunes slow to open. Help please? EtreCheck version: 2.1.5 (108) Report generated 1 January 2015 16:15:39 GMT Click the [Support

  • HP photosmart 6520 scanning doesn't work

    My photosmart 6520 printer was working fine, scanning to computer and printing with no problems then all of a sudden I cannot scan to computer and when I try to scan it puts up the msg No Computer Found. I haven't scanned for a while so when I tried

  • Reader 10.1.3 installation error file in use

    The file in use is identified as adobe reader 7.0.....As I understand, it thinks there is something open that uses reader 7.0.  But there are no open programs....that I am aware of.

  • Problem with OHD Inserted Records

    Hi All, I have one OHD which is fetching the data from Master Data (Text) Info Object by using DTP. If I run the full DTP, 1,20000 records have been inserted into OHD table. But If I go to monitor section of that DTP and If I go to Header, there I am

  • How do you compute exponents

    Ok, I'm taking an introductory computer science class involving Java, and I need help with a program I'm writting. Its actually really simple its just that I don't know the java code to calculate an exponent. For example the program basically is this