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.

Similar Messages

  • 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

  • Import/insert data from XML into Oracle database tables?

    Hi. (I am using JDeveloper 10.1.3.3.0 and Oracle 10g)
    I have been able to export the data from one of my database tables by using a View Object and .writeXML.
    Now, I want to take an xml file that is formatted in the same way as what is spit out by the writeXML and put that info in my database table. I followed online examples and have tried using .readXML like so:
    Element element = XMLDoc.getDocumentElement();
    vo.readXML(element, -1);
    I know it is sort of working, because at first I got an error message that one of the required attributes was missing. So, I added that attribute to my xml file and ran my code. No errors. But, I checked my database, and the new records were not added.
    Is there something I have done wrong? Or is there perhaps something I left out? I also noticed there were several versions of readXML like readFromXML. Which one should I use and how?
    Thanks.

    KUBA, I changed my code to match your example:
    DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    File xmlFile = new File("C:/myfilehere.xml");
    Document doc = db.parse(xmlFile);
    Element element = doc.getDocumentElement();
    vo.readXML(element, -1);
    vo.getDBTransaction().commit();
    I still get no errors, but my database table has no new records.
    Any ideas why?
    Thanks.

  • SQL Loader problem while loading records from txt file to database table.

    I am getting following error while loading records from flat txt file into database table with the help of 'sqlldr' command. I have executed catldr.sql from RDBMS folder but it is still showing same error. I am setting DIRECT = TRUE while issuing sqlldr command. If I try with DIRECT = FALSE then it works fine. Database is Oracle 8i.
    SQL*Loader-951: Error calling once/load initialization
    ORA-24329: invalid character set identifier
    F1 Please.

    Hello,
    Direct path load, can only be used with SQL*Loader and Database have the same version.
    Care to tell the database version and sql*loader version you are using.
    -Sri

  • Query for inserting data from OAF page to database table

    I need to insert a row into a table by getting parameters from pageContext. The fields in this page are from multiple view objects and the data in these fields should be inserted into a table. If anyone can provide solution in this regard will be very much helpful.

    Hi Rma,
    My Understanding is...
    Say you want to display information of 10 customers. Hence there will be 10 rows to display.
    Say number 5 customer has maximum accounts 15 (In case there is variable number of accounts for each customer). Hence there will be max 15 columns.If the above under standing is correct, then a question...is there an upper limit on number of accounts for a customer?
    If yes then I may say...
    Create a custom table with that many columns as of max number of alloweed accounts.
    Write a plsql api to insert column of existing table as row in the custom table.
    Now base your EOs and VOs on that custom table. That may show columns in term of rows on your screen.
    The logic is, instead of converting column data to row in oaf, do it in plsql.
    Now again if it has to be updated by user, create a reverse api to put data from custom table to existing table.
    However, this approach can lack automatic features on existing seeded table(like validations), provided by EO. Hence you must explore PL/SQL Entity objects in Dev guide before going with this approach (both are near same but you may be able to better judge which one will be more suitable for your need.
    Another insant approach which strike in mind is just modifying logic in controller to modify bean hierarchy (adding columns at run time) or by create VO dynamically.
    However, possibly that can put other complexities of personalization and maintainance of code etc.
    Hence the suggestion is...Evaluate all three and judge which one is most suitable for you over all needs (First try with PL/SQL Base EOs Or with the above approach or pure java manipulation)
    Seems too complex approaches all. Other users must pour there thoughts.
    Abdul Wahid

  • 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

  • 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

  • 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

  • How to update Records from Internal table to u2018Zu2019 table?

    Hi Friends,
    How to update Records from Internal table to u2018Zu2019 table.
    I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
    ( my internal table & u2018 Zu2019 table structures are same.)
    Thanking you.
    Regards,
    Subash

    Hi,
    loop at internal table.
    modify <Z- table > from values < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    endloop.
    or
    UPDATE <Z- table > from table < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    Prabhudas

  • To delete duplicate records from internal table

    hi friends,
    i have to delete records from internal table based on following criterion.
    total fields are 7.
    out of which  if 4 fields are same and 5th field is different,then both records must be deleted.
    in case all five fields are same,the program should do nothing.
    for example.
    if there are 3 records as follows
    a1 b1 c1 d1 e1 f g
    a1 b1 c1 d1 e2 w r
    a1 b1 c1 d1 e1 j l
    then first two records should be deleted as four fields are same but fifth(e) field differs.
    but third record should remain as it is evenif first five fields are same for first and third record.
    values of last two fields need not to be consider for deleting the records.

    LOOP AT ITAB.
      V_FILED5 = ITAB-F5. "to compare later
      V_TABIX = SY-TABIX. "used to delete if condition not matches
      READ TABLE ITAB WITH KEY F1 = ITAB-F1
                               F2 = ITAB-F2
                               F3 = ITAB-F3
                               F4 = ITAB-F4.
      IF SY-SUBRC = 0.
        IF ITAB-F5 <> V_FIELD5.
    *--both the records to be deleted,as Field5 is different.
          DELETE ITAB INDEX SY-TABIX. "deletes that record
          DELETE ITAB INDEX V_TABIX. "deletes the current record
        ENDIF.
      ENDIF.
    ENDLOOP.
    Message was edited by: Srikanth Kidambi
    added comments
    Message was edited by: Srikanth Kidambi

  • 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
    );

  • Loading internal table to database table

    Hi all,
    I have created a ztable .also i created an internal table with the same structure as ztable.I have some data in internal table.how to load these data from internal table into database table.how thre insert statement will be.

    Hi,
             Check whether entries are there in the internal table. Also check for the structure.
    MODIFY dbtab FROM TABLE itab.
    UPDATE dbtab FROM TABLE itab.
    just read this.
    If you just want to write (INSERT) 1.5 million rows of an internal table into a database table, use:
    INSERT <table name> FROM TABLE <itab>.
    Transaction Log Size could be a problem, therefore writing in packages could help, but this depends on your row size, your database configuration and on the current changes to your database. May be it runs in one package, if the rows are small (few bytes) then one package will be the fastest but you'll not much faster than with reasonable packages (3-20 MBytes). On Oracle with rollback segments you will probably have no problems at 1.5 million rows.
    <b>Rewrad points</b>
    Regards

  • *Urgent*How to insert data from MS SQL to the table that create at the adobe form?

    Hi,
    I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
    I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
    Thanks

    Tou need to do a couple of things
    1. On the Essbase server, set up an odbc system connection to your MySQL database
    2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
    The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it

  • Inserting data from jsp form to multiple tables !

    Hi,
    I want to insert data from jsp form to two tables
    tables are
    (1) Form
    formId (PK)
    deptName
    (2) Data
    formId (FK)
    sNo
    description
    itemCode
    and the problem is that i want to save information form a jsp form to above two tables and i have only one form.
    so how do i insert data from a jsp form to multiple tables.

    You already know what your form in the jsp will be and what fields they are. You also already know what your database looks like. Using one form, you should be able to break the data down, and give it certain ids and/or names, so that when the form is submitted, you retrieve the correct values corresponding to a specific field and insert it.
    Unless there is something else I am not catching, this seems pretty straight forward.

  • Need to insert into NVARCHAR2 column in a database table

    I need to insert into a table with column type NVARCHAR2(2000) in java.
    Cant use normal setString on that column. How can I do this using PreparedStatement in Java?

    The scenario is:
    I have to read a CSV file which contains a column in Urdu language, and show it on the JTable first.
    Then I have to import the JTable contents into a database table.
    Database Table structure is:
    CREATE TABLE IMPORT_TMP (
    ctype          VARCHAR2(3),
    urdu_name  NVARCHAR2(2000)
    );My java code which inserts into the database table is:
                    Vector dataVector = tableModel.getDataVector();
                    rowVector = (Vector) dataVector.get(row);
                  cType = "";
                    if (rowVector.get(INDEX_BANK) != null) {
                        cType = rowVector.get(INDEX_CTYPE).toString();
                    urduName = "";
                    if (rowVector.get(INDEX_URDU_NAME) != null) {
                        urduName = rowVector.get(INDEX_URDU_NAME).toString();
                    statementInsert.setString(1, cType);
                    statementInsert.setString(2, urduName);I also applied Renderer on the table column, my renderer class is:
    public class LangFontRenderer extends JLabel implements TableCellRenderer {
        private Font customFont;
        public LangFontRenderer(Font font) {
            super();
            customFont = font;
            System.out.println("font = " + font.getFontName());
            this.setFont(font);
        @Override
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            if (value != null) {
                if (value instanceof String) {
                    setText((String) value);
                    return this;
            return this;
        @Override
        public Font getFont() {
            return customFont;
        // overriding other methods for performance reasons only
        @Override
        public void invalidate() {
        @Override
        public boolean isOpaque() {
            return true;
        @Override
        public void repaint() {
        @Override
        public void revalidate() {
        @Override
        public void validate() {
    }I applied the renderer on the column as:
            TableColumn col = IATable.getColumnModel().getColumn(INDEX_URDU_NAME);
            LangFontRenderer langRenderer = new LangFontRenderer(new java.awt.Font("Urdu Naskh Asiatype", 0, 11));
            col.setCellRenderer(langRenderer);It does not give any error but when i query on the database table it does not show the column data in Urdu language.
    Also it does not show the correct value on JTable column, some un-identified symbols.
    Furthermore when I open the CSV file in notepad, it shows the correct language in that column, as I have installed the Urdu language and font on my system.

Maybe you are looking for

  • I can't install Itune. Please help. Error is in the image attached.

    Pleaes help. I am using Windows 7 64 bit. Everytime I tried to open sxstrace.exe. It opened a blak command line box and closed itself in a matter of split-seconds. May I know what is the problem?

  • Release of physical samples

    Dear SAP Experts, I have created inspection lot for a material with movement type 101 against a Purchase order in developmet client. I have attached inspection plan to it. In inspection plan sampling procedure & sample drawing procedure are used. Acc

  • Obiee installation in mac

    hi any one tell me how to install obiee in linux with snap shots it will be better

  • IPad sync with Outlook events issue

    When I accept invitations on my Macbook and turn on my new iPad they are still showing up as pending invitations even though I accepted them on my Macbook. Another funny thing if I accept them on the iPad they will reappear as new requests in a matte

  • Could not resolve service name

    Hi friends. I have this problem where want conect to database 9i: ERROR: "12154" could not resolve service name". I was see LISTANER.ORA, TNSNAMES.ORA, SLQ.ORA files and not seem anything wrong. I have install Oracle 9i database enterprise release 2