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

Similar Messages

  • 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.

  • Inserting multiple records in to database table using webdynpro abap

    Hi all,
    I have created a username inputfield,a button and a table
    with one coloumn.
    If i enter  names in the input field then the values should be
    displayed in that table.
    Even i have got the answer i am not able to insert
    the values in to database(ztable) table.
    i.e. only one value(1st) was inserted the second value was
    not inserted ....
    so kindly send me the coding to insert multiple records
    into the database table......
    by,
    ranjith

    hi Ranjith,
    If you want to insert multiple records from the webdynpro view table to database table then try the following code.
    DATA lo_nd_tablenode TYPE REF TO if_wd_context_node.
      DATA lo_el_tablenode TYPE REF TO if_wd_context_element.
      DATA ls_tablenode TYPE wd_this->element_tablenode.
      DATA it_tablenode LIKE STANDARD TABLE OF ls_tablenode.
      navigate from <CONTEXT> to <tablenode> via lead selection
      lo_nd_tablenode = wd_context->get_child_node( name = wd_this->wdctx_tablenode ).
      get element via lead selection
      lo_el_tablenode = lo_nd_tablenode->get_element(  ).
      get all declared attributes
      lo_nd_tablenode->get_static_attributes_table(
      IMPORTING
        table = it_tablenode ).
    MODIFY databasetablename FROM TABLE  it_tablenode.
    here it_tablenode is the internal table which holds the value from webdynpro view..
    Regards,
    Shamila.

  • 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

  • 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 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.

  • Insert Multiple Rows into a Database

    Hi,
    I've been working on a project that takes an xml document from JMS queue and inserts the data into db. But the problem here is that there can be any number of data sets. I've been using OEPE for my task, but no matter what I do, the data simply isn't inserted. Could any body please help me? Here is a sample message that I'm trying to insert, as well as the XSDs for the JCA and the input documents.
    XSD for JMS Message:
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://www.example.org"
    elementFormDefault="qualified">
    <xsd:element name="cannonical">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="orders">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="data" maxOccurs="unbounded">
         <xsd:complexType>
              <xsd:sequence>
                   <xsd:element name="rowCode" type="xsd:string"/>
                   <xsd:element name="productNumber" type="xsd:string"/>
                   <xsd:element name="attributeType" type="xsd:string"/>
                   <xsd:element name="attributeCode" type="xsd:string"/>
                   <xsd:element name="transactionType" type="xsd:string"/>
                   <xsd:element name="timestamp" type="xsd:dateTime"/>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    JCA XSD:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="OrderDataCollection" type="OrderDataCollection"/>
    <xs:complexType name="OrderDataCollection">
    <xs:sequence>
    <xs:element name="OrderData" type="OrderData" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="OrderData">
    <xs:sequence>
    <xs:element name="prodnum" type="xs:decimal"/>
    <xs:element name="attrtype" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="attrcode" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="transtype" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="1"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="ordertime" type="xs:dateTime" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    Sample Input:
    <?xml version="1.0" encoding="windows-1252"?>
    <ProductData>
    <header>
    <rowCode>H</rowCode>
    <interfaceCode>H6D9J7</interfaceCode>
    <createdOn>
    <date>
    <year>2011</year>
    <month>05</month>
    <day>23</day>
    </date>
    <time>
    <hour>02</hour>
    <minute>05</minute>
    <seconds>11</seconds>
    </time>
    </createdOn>
    <description>Front Shop Item Attributes from FMS to JDA PMM</description>
    </header>
    <body>
    <data>
    <rowCode>D</rowCode>
    <productNumber>0004567</productNumber>
         <attributeType>TTTTTT</attributeType>
    <attributeCode>CCCCCCCjjj</attributeCode>
         <transactionType>A</transactionType>
    <timestamp>
    <date>
              <year>2011</year>
    <month>02</month>
              <day>19</day>
         </date>
         <time>
         <hour>02</hour>
    <minute>05</minute>
    <seconds>11</seconds>
    </time>
    </timestamp>
    </data>
         <data>
    <rowCode>D</rowCode>
    <productNumber>0004567</productNumber>
    <attributeType>TTTTTT2</attributeType>
    <attributeCode>CCCCCCjjj2</attributeCode>
    <transactionType>A</transactionType>
    <timestamp>
    <date>
              <year>2011</year>
    <month>02</month>
              <day>19</day>
         </date>
         <time>
         <hour>02</hour>
    <minute>05</minute>
    <seconds>11</seconds>
    </time>
    </timestamp>
    </data>
    </body>
    <footer>
    <rowCode>Z</rowCode>
    <interfaceCode>H6D9J7</interfaceCode>
    <numberOfRows>000000000002</numberOfRows>
    </footer>
    </ProductData>
    I'll be really grateful if anybody can help me out. Thank you.

    Check below link it may help you out
    how to Insert multiple records using single DB Adapter
    Thanks
    AJ

  • 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

  • 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

  • Inserting Multiple Images into oracle database using JDBC

    I wanted to insert multiple images into database using JDBC by reading it from the file... and i am passing photos.txt(my text file) as an input parameter... I have inserted all the values into the database except for the image part... this is my content of photos.txt file and i have copied all the images into the folder
    *" C:\\photos "*
    *1,in1.jpg,108,19,in-n-out*
    *2,in2.jpg,187,21,in-n-out*
    *3,in3.jpg,308,41,in-n-out*
    *4,in4.jpg,477,52,in-n-out*
    *5,in5.jpg,530,50,in-n-out*
    and i want to store in1.jpg,in2.jpg,in3.jpg,in4.jpg,in5.jpg into the oracle databse using JDBC.... i have tried a lot using BLOB column.... and i have created my table as
    CREATE TABLE PHOTO(
    ID NUMBER NOT NULL PRIMARY KEY ,
    Name BLOB,
    X DOUBLE PRECISION,
    Y DOUBLE PRECISION,
    Tags VARCHAR2(40)
      try {                 // for restaurant System.out.println();System.out.println();System.out.println(); System.out.print("  Creating Statement for Photo...\n");             stmt2 = con.createStatement ();                       stmt2.executeUpdate("delete from PHOTO"); stmt2.executeUpdate("commit"); PreparedStatement stmt3 = con.prepareStatement ("INSERT INTO PHOTO VALUES (?, ?, ?, ?, ?)");             System.out.print("  Create FileReader Object for file: " + inputFileName1 + "...\n");             FileReader inputFileReader2 = new FileReader(inputFileName1);             System.out.print("  Create BufferedReader Object for FileReader Object...\n");             BufferedReader inputStream2  = new BufferedReader(inputFileReader2);             String inLine2 = null;                         String[] tokens; //            String[] imageFilenames = {"c:\\photos\\in1.jpg","c:\\photos\\in2.jpg","c:\\photos\\in3.jpg","c:\\photos\\in4.jpg","c:\\photos\\in5.jpg", //  "c:\\photos\\in6.jpg","c:\\photos\\in7.jpg","c:\\photos\\in8.jpg","c:\\photos\\in9.jpg","c:\\photos\\in10.jpg","c:\\photos\\arb1.jpg","c:\\photos\\arb2.jpg", //  "c:\\photos\\arb3.jpg","c:\\photos\\arb4.jpg","c:\\photos\\arb5.jpg","c:\\photos\\den1.jpg","c:\\photos\\den2.jpg","c:\\photos\\den3.jpg", //  "c:\\photos\\den4.jpg","c:\\photos\\den5.jpg","c:\\photos\\hop1.jpg","c:\\photos\\hop2.jpg","c:\\photos\\hop3.jpg","c:\\photos\\hop4.jpg","c:\\photos\\hop5.jpg"};               File file = new File("C:\\photos\\in1.jpg");            \\ ( Just for example  )           FileInputStream fs = new FileInputStream(file);                         while ((inLine2 = inputStream2.readLine()) != null) {               tokens= inLine2.split(",");             st2 = new StringTokenizer(inLine2, DELIM);                                                             stmt3.setString(1, tokens[0]);               stmt3.setBinaryStream(2, fs, (int)(file.length()));               stmt3.setString(3, tokens[2]);               stmt3.setString(4, tokens[3]);               stmt3.setString(5, tokens[4]);               stmt3.execute(); //execute the prepared statement               stmt3.clearParameters(); 
    As i am able to enter one image file by above code in1.jpg in to the oracle database.... but i am not able to insert all the image file in to the database.....do tell me what should i do.... and can you give me the example on the basis of the above code of mine...
    do reply as soon as possible..

    jwenting wrote:
    that depends. Putting the images in BLOBs prevents the file locations stored in the database from getting out of synch with the filesystem when sysadmins decide to reorganise directory structures or "archive" "old" files that noone uses anyway.True, but it really comes down to a business decision (cost-benefit analysis). If you have the bucks, the expertise, and the time, go with the Blobs, otherwise go with the flat files.

  • 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

  • Entering multiple records into one database

    Hi Guys,
    I have created a form that repeats the text fields. I want to
    record all the entries into an access database. I am trying to use
    the SQL Insert Command but I am receiving a mismatch criteria
    error. Here is the command:
    Command1.CommandText = "INSERT INTO tblWeek (Classdate, Week,
    Day, Activity, Location) VALUES ('strDate', 'strWeek', 'strDay',
    'strActivity', 'strLocation') "
    Any help would be greatly appreciated

    If you have multiple fields with the same name, they pass a
    single form
    value across that contains a comma delimited list.
    You need to pick up this and loop through it to grab each
    value.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "sham!" <[email protected]> wrote in message
    news:e4fd6b$a16$[email protected]..
    > Hi Guys,
    > I have created a form that repeats the text fields. I
    want to record all
    > the
    > entries into an access database. I am trying to use the
    SQL Insert Command
    > but
    > I am receiving a mismatch criteria error. Here is the
    command:
    > Command1.CommandText = "INSERT INTO tblWeek (Classdate,
    Week, Day,
    > Activity,
    > Location) VALUES ('strDate', 'strWeek', 'strDay',
    'strActivity',
    > 'strLocation') "
    >
    > Any help would be greatly appreciated
    >

  • Retrive Multiple Records Into A database Block

    hi, all
    i would like to know if there is any document or references wich illustrait the way of retriving Multi records from a procedure built on database side into a database block using form 6i ??
    My Problem is : i create a procedure in the database which retrive a multiple records and the variable from procedure (out) are the same value from Form side (in). but it always fetch the whole records at the same record position in the block as the cursor raised on . i found a way explian how to mintain a set or record using a record type and create a table of that record type , but still don't' know how deal calling the procedure from the form side .
    Any advice of this issue will be greatfull and if sample of code provided will be better
    Thanks in Advance
    Regards
    Omar

    You can try something like this:
    PROCEDURE POPULATE_BLOCK IS
    cursor c1 is
    SELECT <your column names>
    FROM <your table name>
    where <your where condition>
    BEGIN
    open c1;
    go_block('<your block name');
    first_record;
    loop
    fetch c1 into
    :<your block name>.<your column name 1>,
    :<your block name>.<your column name 2>,
    etc,etc
    exit when c1%NOTFOUND;
    next_record;
    end loop;
    close c1;
    first_record;
    END;
    so your code might actually look something like this:
    PROCEDURE POPULATE_BLOCK IS
    cursor c1 is
    SELECT distinct
         a.pog_dept
         ,a.pog_number
         ,a.pog_level
         ,a.pog_id
    ,a.start_date
         ,a.transmit_date
    ,a.deactivate_date
         ,b.pog_description
    FROM pog_stores_msi a, pog_master_msi b
    where a.pog_dept = :b_main.bi_dept
    and a.pog_number = :b_main.bi_pog_number
    and a.pog_level = :b_main.bi_pog_level
    AND A.POG_ID = :B_MAIN.I_POG_ID
    and a.pog_dept = b.pog_dept
    and a.pog_number = b.pog_number
    and a.pog_id = b.pog_id;
    BEGIN
    open c1;
    go_block('b_main');
    first_record;
    loop
    fetch c1 into
    :b_main.bi_dept
    ,:b_main.bi_pog_number
    ,:b_main.bi_pog_level
    ,:b_main.i_pog_id
    ,:b_main.i_start_date
    ,:b_main.i_transmit_date
    ,:b_main.i_deactivate_date
    ,:b_main.i_pog_desc;
    exit when c1%NOTFOUND;
    next_record;
    end loop;
    close c1;
    END;
    Hope this helps,
    NumbNutz

  • Can you use wifi sync with multiple libraries and multiple devices

    Hi all
    Does anyone know if you can use wifi sync with 1 computer, 2 libraries and 2 devices?
    I have my wife's iPhone synced to 1 library and mine to another library but on the same computer. Will wifi sync work this way or do you need iTunes to be open to the correct library for it to work? As I know you can't have 2 instances of itunes open on the same computer.
    Anyway thanks for any help

    I have been looking more and more into this and it appears no.
    You need to have iTunes running on the computer to enable it to wifi sync. You can use 2 devices on 1 library but if you don't have all the right options ticked you will then end up with each others stuff on each others device.
    To enable wifi sync you need to have your iDevice connected to the same wifi network as your computer and iTunes open on that computer.
    With my library open it detected my wife's phone and started to sync. Hasty push of cancel sync button lol.
    There is a guide on here somewhere about multiple devices with 1 library which I can't find at the moment that tells you which options to tick so only your stuff stays on your device the the other half's on their device.
    Its basically tick 'sync only ticked songs and videos' under summary of your device
    Under apps take tick out of 'automatically sync new apps'
    Then under edit->preferences click device and click prevent i's from syncing automatically
    I think you should then be able to sync both devices to 1 library with mucking them up too much
    Hopefully please correct me if I'm wrong
    I have tried not doing the last step and asking it to open itunes automatically when phone is connected but this does not work with wifi sync
    Have fun hopefully someone else can give us a better answer

  • HT4914 Can you use iTunes Match on multiple devices with different apple id's ?

    I have multiple phones with the same iTunes ID but they have different apple ID , will the iTunes Match work with all my devices ?

    I've got the latest version of iTunes & it's supposed to be able to be enabled under top panel "store" then appear down left side panel to subscribe. Which makes me think that it musn't be able to be used if you're running XP as it's not there....

Maybe you are looking for