Insert multiple records into database through internal table

Hi
  please help me how to insert multiple records into database through internal table

Hi,
Welcome to SCN.
Press F1 on INSERT statement and you will teh syntax as well the docu for the same.

Similar Messages

  • Regarding reading multiple records into a single internal table..

    hi experts,
    Need your help, i have a requirement like this.
    i will have a input file like this
    D 123   Suresh    12/01/2008
    E ven   sha         5432
    E ven   sha       5432
    D 153   Sachin    11/01/2008
    E ven   sha      5432
    Now all i need to consider from D to E  (i.e., before next D) as a single record and i need to preare a separate excel,
    So that E records can be max 9. So we cant expect this will be always 2 or 3 or 4.
    So how can i do this upload and process..
    give some idea.
    Thanks,
    Suresh

    Hi,
    Once you transfer the values from input file to internal table.
    loop through all records of internal table .
    check the first letter using offset
    e.g  if Itab-field+0(1)  = 'D'
           elseif  Itab-field+0(1)  = 'E'.
           endif.
         Populate the work area of internal table until you find the next 'D' once you find 'D' again ...append the work area to internal table......clear work area.
    Regards,
    Rahul

  • Need help on inserting multiple records into database

    Hello every body,
    In my web page there is multiple select box.In that contains
    service-servicecategory-priority-filecontent -data in each item.
    suppose if select ten items and press submit button then that ten item schould be insert into database at a time. I don't know how to do?
    if any body know or any sample code ..plz help me.
    thanks in advance.

    suppose if select ten items and press submit button
    then that ten item schould be insert into database at
    a time. I don't know how to do?
    if any body know or any sample code ..plz help me.I'll give you the answer if you give me dukes.

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • Insert multiple records into a table(Oracle 9i) from a single PHP statement

    How can I insert multiple records into a table(Oracle 9i) from a single PHP statement?
    From what all I've found, the statement below would work if I were using MySQL:
         insert into scen
         (indx,share,expire,pitch,curve,surface,call)
         values
         (81202, 28, 171, .27, 0, 0, 'C' ),
         (81204, 28, 501, .25, 0, 0, 'C' ),
         (81203, 17, 35, .222, 0, 0, 'C' ),
         (81202, 28, 171, .27, 2, 0, 'C' ),
         (81204, 28, 501, .20, 0, 1, 'C' ),
         (81203, 28, 135, .22, 1, 0, 'C' )
    The amount of records varies into the multiple-dozens. My aim is to utilize the power of Oracle while avoiding the i/o of dozens of single-record inserts.
    Thank you,
    Will

    You could look at the INSERT ALL statement found in the documentation here:
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_913a.htm#2133161
    My personal opinion is that you probably won't see any benefit because under the hood I think Oracle will still be doing single row inserts. I could be wrong though.
    The only way to confirm was if you did a test of multiple inserts vs an INSERT ALL, that is if the INSERT ALL met your requirements.
    HTH.

  • Insert multiple records into Oracle using Java

    Hi,
    Has anyone tried to insert multiple records into an Oracle table from Java? I have my data in a Java collection.Can I send a Java Collection to an Oracle Package as a PL/SQL Table Type? My problem is I dont want to instantiate a CallableStatement object everytime I do an insert. Instead I want to do that only once and then insert multiple records in one operation.
    Any suggestions will be appreciated,
    Thanks,
    Alex

    Hi Mensa,
    I went thru the code example in your book in chapter 8 (downloaded it from OTN). It looks like the java code for "public class myPLSQLIndexTab" might be a java stored procedure stored in the oracle database?
    Pardon my ignorance because I've never worked on java code in the oracle database itself but how would I call such a program outside the oracle database? For example say I have a batch job that downloads data from a webservice and that batch job is written in java and its sitting on a batch server somewhere on the network. But the java program that inserts data into the database is sitting in the oracle database (also somewhere in the same network). How can the java code sitting on the batch server talk to the java code sitting on the oracle server? Is it the same as calling a pl/sql package using CallableStatement?
    Thanks
    Alex

  • Inserting multiple records into a database from a table

    I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess)
    table name: Table1 ( in my form )
    Database table : movies_comments ( as posted in stefan's forums ).
    table columns: username, movieid, comments
    i am using the following code.
    Database.ExecSQL() function is as posted in stefcamerons forums.
    var tlength = xfa.resolveNode("form1.#subform[0].Table1.Row1[*]").length;
    xfa.host.messageBox("tlength is :" +tlength);
    for ( var i = 1; i <= tlength; i++)
    var username = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].user_name").rawValue;
    var movieID = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].movie_id").rawValue;
    var commentS = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].comment_").rawValue;
    Database.ExecSQL("INSERT INTO movie_comments (username, movieId, comment) VALUES ('username','movieID', 'commentS');");
    i am trying to insert multiple records using the code above. But i am getting error
    GeneralError: Operation failed.
    XFAObject.resolveNode:1:XFA:form1[0]:#subform[0]:Button1[0]:click
    SOM expression returned list when single result was expected
    suggest me an alternate way to insert multiple records from a table into a database.
    thank Q

    figured it out. I changed the ...OR (alternative names = colname) in the recordset to ...OR (alternative names LIKE %colname%). Works like a charm now- the result of a good night's sleep.

  • Can you use ESB to insert multiple records into a Database

    We have an XML file that has a Parent/Child relationship.
    In situation 1 we have a single parent record in the xml file. We can insert the record into the database successfully.
    In situation 2 we have a parent and a an associated child record. By using a filter expression to identify the existence of the child record we can route to the first DB Adapter to insert the parent then to the second DB Adapter to insert the child.
    Is this final scenario logical and also possible.
    Situation 3 we have multiple child records associated to a single parent. So we would first insert the parent record then insert all the child records.
    Thanks

    I use PL/SQL for this if you are using Oracle.
    Have a look at this post, it is for AQ but the concept can be used for PL/SQL
    Re: Can I pass a pl/sql table as a parameter from a database adaptor
    I will send you an example
    cheers
    James

  • Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency

    I need to insert multiple rows into a database table using the JDBC adapter (receiver).
    I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
    Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?

    Hi Bhavesh/Kanwaljit,
    If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
    Why i am saying this?
    If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
    <i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
    Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
    Doesnt this mean that rows are inserted one by one?
    Correct me if i am wrong.
    This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
    Regards,
    Sumit

  • Inserting Multiple Records into two table

    I want to insert records from a ADF swing form into two tables. In the first table the primary key is generated by a trigger and then I need to retrieve the primary id generated and then insert multiple records in another table using the primarykey obtained from the first table as foreign key.
    How to do this ?

    User,
    If you're using ADF Business components, have a read on the DBSequence data type. If you have two VO's linked by a view link, and the FK is a DBSequence type, all this happens for you out-of-the-box.
    Hope this helps,
    john

  • Insert Multiple Records into Multiple ZTABLEs inside the BAPI

    Hi,
    I have a requirement to Insert or Update Multiple Records into a ZTABLE inside the BAPI. Is there any special approach inside the BAPI to insert or update ZTABLEs with multiple records. It looks like the simple INSERT Statement is not working. Can you please suggest me a Suitable solution for this req?
    Thanks and Regards,
    Kannan

    Hi,
    INSERT ZTABLE FROM TABLE ITAB.
    The itab structure should be of the structure ZTABLE..
      Same for MODIFY and update.
      MODIFY ZTABLE FROM TABLE ITAB..
    Thanks,
    Naren

  • Insert Multiple records using Database adapter with Stored procedure func

    Hi All,
    I want to insert multiple records on a database using a stored procedure. I wanted to insert those records using a Database Adapter and the Database adapter should be invoked by a Mediator.
    Can somebody suggest me with ideas whether it can be acheived with OOB capabtilities in SOA suite or not?
    Thanks for your help in advance.
    Thanks,
    Shiv

    The use case you want to achieve is feature supported by the DBAdapter and it is possible to invoke the same from mediator.
    Please have a look at the oracle documentation and you should be able to get the necessary information.
    The below links should help you as well:
    http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10231/adptr_db.htm
    http://blogs.oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html
    There are some video tutorials as well :)
    http://www.youtube.com/watch?v=dFldS-fDx70 This should also help
    Thanks,
    Patrick

  • How to insert multiple records into a table?

    hi all 
    i have a table that name is : TiketsItem
    now i  want to 100 records insert my table
    for example : TicketsHeaderRef=52000
    Active=False
    TicketsItemId=45000 to 45100
    how to insert TicketsItemId  45000 to 45100 in my table
    thanks all
    Name of Allah, Most Gracious, Most Merciful and He created the human

    So, you just want to insert the serialized data into the table, without useDate or WKRef? I'm assuming these values will be updated later?
    Try something like this:
    DECLARE @TicketsHeader TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsHeader (TicketsItemID, ticketsHeaderRef, active)
    VALUES (52000, @startInt, 0)
    SET @startInt = @startInt + 1
    END
    SELECT *
    FROM @TicketsHeader
    thanks 
    i edited your codes:
    DECLARE @TicketsItem TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsItem (TicketsItemID, ticketsHeaderRef, active)
    VALUES (@startInt,52000 , 0)
    SET @startInt = @startInt + 1
    END
    when i execute:
    SELECT *  FROM TiketsItem
    i do not see any records inserted in TiketsItem
    how to solve it?
    Name of Allah, Most Gracious, Most Merciful and He created the human

  • Inserting multiple columns into database using dbtool set

    I have  a labVIEW program that is currenly simulating voltage and a current signal using the DAQ Assistant. I'm using the database connectivity toolset. I am currently able to insert one signal into the database converted to a float(I can insert both into the same column as bianary but it needs to be stored as a usable format and in seperate columns.)
    The problem I am having is at the DB Tools Insert Data block. I have the connection, dbTable, error code, and create table boolean being passed into it. Where I am a little lost is how to set the columns I want to store the multiple signals into.
    If someone could break that part down for me that would be great. In short, I want to store voltage(channel0) and current(channel1) from the DAQ Assistant into their own respective columns in the db.
    Message Edited by DonPoulson on 07-10-2007 11:04 AM

    Don,
    This particular forum is specific to TestStand, not LabVIEW or Multifunction DAQ. You may have a better chance at responses by posting to either of those forums rather than here.
    Brandon Vasquez | Software Engineer | Integration Services | National Instruments

  • Reg : Joining the all internal table records into a single internal table

    Hi all
    I am having 5 internal tables and i want to put all these entries in a single intrnal table and my requirement is for each and every record it has to go through all the internal tables and if an entry is missing meand.it has to go through the other internal tables and for missing entries i should leave it as blank and rest of the contents i have to display can any please gimme some logic how to do this??
    Thanks in advance

    Don't have time or will to deliver turnkey solutions, but here is a frame:
    LOOP AT itab1...
      READ TABLE itab2 WITH TABLE KEY... (fields linking itab1 and itab2)
      READ TABLE itab3 WITH TABLE KEY... (fields linking itab1 and itab3)
      LOOP AT itab4 WHERE... (fields linking itab1 and itab4)
        READ TABLE itab5 WITH TABLE KEY... (fields linking itab4 and itab5)
        MOVE-CORRESPONDING... (all five work areas to target work area)
        APPEND itabtarget...
      ENDLOOP.
    ENDLOOP.
    so use READ when there is a 1:1 relationship (e.g. check table entry), and LOOP when there is a 1:N relationship (e.g. items for a header)
    Thomas

Maybe you are looking for

  • How can I create a vector path boundary around an image?

    I have enclosed a screenshot of an image created in Photoshop CS4 with a wacom. It shows a grey boundary stroke around the entire image which was created with edit/stroke, then color and width of stroke selected. What I want to do is to bring this im

  • Shadows disappearing when PDF/X-1 made?

    Ive created a file in InDesign CS3 with some simple swooshes at the bottom... All art was created in InDesign (not placed from Illustrator). I need to create a PDFX-1 file from this for a vendor.... However, when I do this, I lose the shadows on swoo

  • Your Feedback please on GUI design/development

    Hi everyone, I am doing some research on GUI development in java and I would like your feedback on a few things: (1) Do you consider GUI development in java complex and time consuming(more than what it should be)? (2) How satisfied are you with exist

  • BI Admin Cockpit: Program variant missing in Process chain

    Hi, I'm installing BI Admin Cockpit and have troubles with Process chains. I followed the installatin guide and had problems activating process chains: 0TCT_C2_INIT_P01 and 0TCT_MD_C_FULL_P01 because of missing InfoPackages. I solved this by installi

  • Very Urgent : Reterival of AWKEY field from BKPF table

    Hi, I am making a report in which i have to make relation of 2 fields BKPF-AWKEY and MKPF-MBLNR . but the problem is i am not to reterive data from it as i have to make inner join among these fields so data can be reterived fmo these tables. plz prov