Multiple tables In JDBC ADapter

Hi All,
         Can we access more than 1 table in one JDBC adapter? If yes how?
XIer

Hey
on receiver side create multiple STATEMENT Level tags, one for each table and the appropriate access level tags.
on sender side you can only have one select Query.
so try to use a JOIN SQL Statement .
Thanx
Aamir
Message was edited by:
        Aamir Suhail

Similar Messages

  • Updating multiple tables using JDBC Adapter

    Hi,
    I am trying to insert/update multiple tables using one message via JDBC adapter. The following is the message being posted. However, only the first statement was executed. Anything wrong?
    Thanks in advance!
    Hart
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration"><DeliveryData><DelHeader action="UPDATE_INSERT"><table>DelHeader</table><access><DelNo>0080000230</DelNo><DelType>LF</DelType><XOverwrite>X</XOverwrite><ShipTo>0000000026</ShipTo><SoldTo>0000000026</SoldTo><Priority>00</Priority><DocDate>02/17/2007</DocDate><GText>CIF Test</GText><DelDate>02/20/2007</DelDate><PickDate>02/20/2007</PickDate><ShipPoint>NO02</ShipPoint><PackCount>00000</PackCount></access><key><DelNo>0080000230</DelNo></key></DelHeader>
    <DelItem action="INSERT"><table>DelItem</table><access><DelNo>0080000230</DelNo><ItemNo>000010</ItemNo><GText>10# GRAN-GREAT VALUE</GText><Material>G04410G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BL</UOM></access><access><DelNo>0080000230</DelNo><ItemNo>000020</ItemNo><GText>25# GRAN- GREAT VALUE</GText><Material>G04025G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BG</UOM></access></DelItem></DeliveryData></ns0:DeliveryDBUpdate>

    Hi,
    You need 2 STATEMENT level tags,
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration">
    <b><DeliveryData1></b>
    <DelHeader action="UPDATE_INSERT">
    <table>DelHeader</table>
    <access>
    <DelNo>0080000230</DelNo>
    <DelType>LF</DelType>
    <XOverwrite>X</XOverwrite>
    <ShipTo>0000000026</ShipTo>
    <SoldTo>0000000026</SoldTo>
    <Priority>00</Priority>
    <DocDate>02/17/2007</DocDate>
    <GText>CIF est</GText>
    <DelDate>02/20/2007</DelDate>
    <PickDate>02/20/2007</PickDate>
    <ShipPoint>NO02</ShipPoint>
    <PackCount>00000</PackCount>
    </access>
    <key>
    <DelNo>0080000230</DelNo>
    </key>
    </DelHeader>
    <b><DeliveryData1></b>
    <b><DeliveryData2></b>
    <DelItem action="INSERT">
    <table>DelItem</table>
    <access>
    <DelNo>0080000230</DelNo>
    <ItemNo>000010</ItemNo>
    <GText>10# GRAN-GREAT VALUE</GText>
    <Material>G04410G611</Material>
    <Plant>6005</Plant>
    <SLoc>6005</SLoc>
    <RefDoc>mmenon32</RefDoc>
    <RefItem>00000000</RefItem>
    <DelQty>5.000</DelQty>
    <UOM>BL</UOM>
    </access>
    <access>
    <DelNo>0080000230</DelNo>
    <ItemNo>000020</ItemNo>
    <GText>25# GRAN- GREAT VALUE</GText>
    <Material>G04025G611</Material>
    <Plant>6005</Plant>
    <SLoc>6005</SLoc>
    <RefDoc>mmenon32</RefDoc>
    <RefItem>00000000</RefItem>
    <DelQty>5.000</DelQty>
    <UOM>BG</UOM>
    </access>
    </DelItem>
    <b></DeliveryData2></b>
    </ns0:DeliveryDBUpdate>
    Try with such a strcuture and let us know if it works.
    Regards
    Bhavesh

  • 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

  • Populating SAP Database table using JDBC adapter

    Hi Folks,
        I have a requirement to populate a SAP database table say ZTABLE using XI. The Model is the table has to be populated through a file which will be processed by SAP XI. Basically this is a File to JDBC scenario. The database used is ORACLE. Kindly provide me some idea to go ahead.

    I tried to place the MS access table in the shared folder of the Application server system but still it seems the table is not being populated.
    did you check the log in your receiver channel? (/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn)
    The requirement is to update the tables directly as those are the custom tables.
    i would still say that do not update SAP tables directly from XI/ PI.....this is not a standard architecture/ solution....

  • Pure SQL of Select query on multiple tables in DB Adapter

    I am trying use pure sql approach for a custom sql query on multiple tables for a DB adapter by modifying toplink_mappings.xml. But i am not getting other tables in my xsd. Please help.

    hi Ravi,
    can you pls be a bit clear? what is this about? where you are using?
    thanks,
    sneha.

  • ** Is it possible to give select command from multiple tables in JDBC

    Hi Friends,
    Is it possible to give the select command to select data from multiple tables directly in the 'Query SQL statement' in JDBC sender communication channel ? (Instead of Stored Procedure)
    Thanking you.
    Kind Regards,
    Jeg P.

    Hi,
    here is a sample:
    Table #1
    Header
    Name EmpId Status
    Jai 5601 0
    Karthik 5579 0
    Table #2
    Name Contactnumber
    Jai 9894268913
    Jai 04312432431
    Karthik 98984110335
    Karthik 04222643993
    select Header.Name, Header.EmpId, Item.Contactnumber from Header,Item where Header.Name = (select min(Header.Name) from Header where Header.Status = 0) and Header.Name = Item.Name
    Regards Mario

  • Inserting data into multiple tables in jdbc

    I am doing on file to jdbc. Now I got a requirement to insert data into multiple tables on the receiver side. How can I do this ?

    Hi,
    you are going to insert data into 4 tables in a sequence one after another , I see three options.
    1) Stored procedure and 2) creating 4 statement data structure (one for each table)
    The third option is writing a SQL with join for the 4 tables and use action command = SQL_DML. Example as follows....
    Write SQL code and place it in access tag. Pass values for the columns using key tag...
    <stmt>
        <Customers action="SQL_DML">
          <access> UPDATE Customers SET CompanyName=u2019$NAME$u2019, Address=u2019$ADDRESS$' WHERE CustomerID='$KEYFIELD$u2019
          </access>
          <key>
            <NAME>name</NAME>
            <ADDRESS>add </ADDRESS>
            <KEYFIELD>1</KEYFIELD>
          </key>
        </Customers>
      </stmt>
    Refer this http://help.sap.com/saphelp_nwpi71/helpdata/en/44/7b7855fde93673e10000000a114a6b/content.htm
    Hope this helps ....

  • WRITING MULTIPLE INES USING JDBC ADAPTER

    We are working a solution file-Jdbc that presents the following xml after activation of the cenario in question:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <p2:P1_Funcionario_MT xmlns:p2="urn:cemig:P1:RH">
    - <ESTRUT_FUNC>
    - <TFUNCIONARIO ACTION="UPDATE_INSERT">
    - <ACCESS>
      <NUM_MATRICULA>123460</NUM_MATRICULA>
      <NOM_FUNCIONARIO>ANTONIO5CARLOS BORGES BATISTA</NOM_FUNCIONARIO>
      <DES_FUNCAO>ENG EMPREENDIMENTO1</DES_FUNCAO>
      <SIG_ORGAO>1</SIG_ORGAO>
      <END_LOCAL_TRAB>1</END_LOCAL_TRAB>
      <END_FUNCIONAL>END FUNC</END_FUNCIONAL>
      <NUM_TELEFONE>2737328041</NUM_TELEFONE>
      <NOM_CIDADE>AIMOR\'c9S</NOM_CIDADE>
      <DAT_NASCIMENTO>19610620</DAT_NASCIMENTO>
      <TIP_SITUACAO>T</TIP_SITUACAO>
      <NUM_UA>UA</NUM_UA>
      <DAT_ATUALIZACAO>2005/10/19</DAT_ATUALIZACAO>
      <DES_EMAIL>[email protected]</DES_EMAIL>
      <NUM_SIT>1</NUM_SIT>
      <COD_CEP_LOTACAO>35200-000</COD_CEP_LOTACAO>
      <DES_END_LOTACAO>FAZENDA VI\'c7OSA</DES_END_LOTACAO>
      <NUM_END_LOTACAO>1</NUM_END_LOTACAO>
      <DES_CIDADE_LOTACAO>AIMOR\'c9S</DES_CIDADE_LOTACAO>
      <NUM_CEL_CORPORATIVO>1</NUM_CEL_CORPORATIVO>
      <DES_LOCAL_TRABALHO>FAZENDA VI\'c7OSA</DES_LOCAL_TRABALHO>
      <COD_EMPRESA>51</COD_EMPRESA>
      <END_LOCAL_COMPLETO>USINA AIMOR\'c9S</END_LOCAL_COMPLETO>
      </ACCESS>
    - <ACCESS>
      <NUM_MATRICULA>123461</NUM_MATRICULA>
      <NOM_FUNCIONARIO>ANTONIO6CARLOS BORGES BATISTA</NOM_FUNCIONARIO>
      <DES_FUNCAO>ENG EMPREENDIMENTO2</DES_FUNCAO>
      <SIG_ORGAO>1</SIG_ORGAO>
      <END_LOCAL_TRAB>1</END_LOCAL_TRAB>
      <END_FUNCIONAL>END FUNC</END_FUNCIONAL>
      <NUM_TELEFONE>2737328041</NUM_TELEFONE>
      <NOM_CIDADE>AIMOR\'c9S</NOM_CIDADE>
      <DAT_NASCIMENTO>19610620</DAT_NASCIMENTO>
      <TIP_SITUACAO>T</TIP_SITUACAO>
      <NUM_UA>UA</NUM_UA>
      <DAT_ATUALIZACAO>2005/10/19</DAT_ATUALIZACAO>
      <DES_EMAIL>[email protected]</DES_EMAIL>
      <NUM_SIT>1</NUM_SIT>
      <COD_CEP_LOTACAO>35200-000</COD_CEP_LOTACAO>
      <DES_END_LOTACAO>FAZENDA VI\'c7OSA</DES_END_LOTACAO>
      <NUM_END_LOTACAO>1</NUM_END_LOTACAO>
      <DES_CIDADE_LOTACAO>AIMOR\'c9S</DES_CIDADE_LOTACAO>
      <NUM_CEL_CORPORATIVO>1</NUM_CEL_CORPORATIVO>
      <DES_LOCAL_TRABALHO>FAZENDA VI\'c7OSA</DES_LOCAL_TRABALHO>
      <COD_EMPRESA>51</COD_EMPRESA>
      <END_LOCAL_COMPLETO>USINA AIMOR\'c9S</END_LOCAL_COMPLETO>
      </ACCESS>
    - <KEY>
      <NUM_MATRICULA>123460</NUM_MATRICULA>
      <DES_FUNCAO>ENG EMPREENDIMENTO1</DES_FUNCAO>
      </KEY>
    - <KEY>
      <NUM_MATRICULA>123461</NUM_MATRICULA>
      <DES_FUNCAO>ENG EMPREENDIMENTO2</DES_FUNCAO>
      </KEY>
      </TFUNCIONARIO>
      </ESTRUT_FUNC>
      </p2:P1_Funcionario_MT>
      The Message Monitor pointed to the Integration Server presents the following error:
    2005-10-19 17:59:55 Error Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'TFUNCIONARIO' (structure 'ESTRUT_FUNC'): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of PRIMARY KEY constraint 'PK_TFUNCIONARIO'. Cannot insert duplicate key in object 'TFUNCIONARIO'.
    We checked the primary key and it is present in the SQLSERVER table ( tfuncionario ). But the XI should rewriting this line and is not doing.
    Anyone knows what is happening?
    Thanks and regards,
    Midervilson de Andrade.

    Hi,
    are you sure there are no records in tfunctionario table with 123460 and 123461.
    please check the database, if possible clear the table (delete all data) and try again.
    Naveen

  • Inner Join Condition For  Database Tables in JDBC Adapter

    Hi
    Is there any restriction for Number of database tables to Write Inner join Condition in JDBC.
    Thanks

    Venkat,
    No there is no restriction in Inner join. If your query executes perfectly in target Database then the same query will exceute perfectly while calling through XI.
    Best regards,
    raj.

  • Updating 3rd parties db table using JDBC adapter at sender side

    hi all.
    i just want to know how i can updated the 3rd party db table field.
    my scenario is just to retrieve data from 3rd party DB table where the condition is like " to select records where processed (field name ) = " ".
    but i just need to update this field to x immediately after retrieving data from it.
    so i simply wote the sql statement select REC_NO, ACTN_DAT, METRNO, MET-READ from PHAKAMA_CONN where processed = " ". under jdbc CC query sql stmt  at sender side .
    but i want to know how we can updated the processed (field ) from " " to "x"immeidtely after retrieving.
    so could any body advice me how we can achiev this through UPDATE SQL STMT under sender jdbc cc.i just want to know wat stmt do we need to srite under this.
    waiting for u r response.
    cheers.
    seeta ram.

    Ram,
    Execute your Select statement as needed and in the sender jdbc communication channel in the update SQL statement give this:
    UPDATE <tablename> SET <fieldname> = 'X' WHERE <fieldname>= ' '
    Also just to make sure if you have access to the database just login and execute this statement which should give the results as expected. If this works here successfully then it executes the same in XI also.
    Regards,
    ---Satish

  • JDBC-XI-FILE scenario. How to extract data from multiple tables

    Hi,
    At this moment I didn't have the access for XI system. So here I have some silly question. Could you please clarify the same ??
    If I got to extract data from single table using JDBC adapter I can put the below query in communication channel
    SELECT *FROM orders WHERE new='true'.
    But if I got to extract data from multiple tables, logic to be used should be like as shown below. ( from previous thread------prabhu).
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    union
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    But my query is ........how to put the above entire code in one line. (i.e in Qery place of communication channel ) ??
    Thanks
    Kumar

    Hi Palnati,
        You either use a select query with join or a stored procedure which will contain the logic to extract the data from multiple tables. But, the limitation in case of stored procedure is u can hv only one selct query in it.
    You write ur actual query provided in the parameter 'Query SQL Statement". u can also wrt a stored procedure in it. Also, u can provide a update statement in it which will update a certain flag so tht u don selct the data again.
    Check the following link
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm</a>
    Regards,
    Akshay
    Message was edited by:
            Akshay Salunke

  • Calling Stored Procedure from JDBC Adapter

    Hello,
    I am Updating a SQL Server Table using JDBC Adapter.
    Now I have multiple input rows and the procedure needs to be called for each set.
    Do I need to use multimapping for this or just generating multiple <b>Statement</b> node will solve?
    Also For this will there is any knows/ forseen problem (like Transaction handling) that I need to take care of?
    Thanks and Regards,
    Himadri
    Message was edited by:
            Himadri Chakraborty

    Himadri,
    You can just create multiple statement nodes in one message.
    I am not aware of any known or foreseen issues with this approach.
    Kind regads,
    Koen

  • JDBC Adapter Performance

    Hi Experts,
    We have nearly 60 interfaces will read/write from/on DB and AS400 tables.
    We are facing so many problems in production system. Everyday the messages are strucking at Adapter Engine. All messages are in "To be delivered" stage. If we can stop some cc's then it is processing slowly even the Database is using 60% usage.
    We tried to create logical views(Instead of Physical views) on DB and AS400 even the performance has not increased.
    We have used "prefetch=false" at "connection" on JDBC adapter but no use.
    We can use "Disconnect after each message processed", but my client is not agree with this option.
    We don't want to increase the connections to DB and AS400.
    Is there any parameters needs to be updated at JDBC Adapter?
    Help needed...
    Regards,
    Rams.

    Hi,
    The below links may help u.
    JDBC ADAPTER
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 - File to JDBC
    JDBC - http://help.sap.com/saphelp_nw2004s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    multiple tables with JDBC - http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    JDBC Response /people/swaroopa.vishwanath/blog/2006/12/28/send-rfc-to-sap-xi-150-asynchronous
    Regards
    Pullarao

  • About JDBC Adapter?

    Hi experts,
           iam practicing scenario on company sandbox,i want to work using JDBC adapter,what are the prerequisite to do that senario.
          I want to do JDBC->XI->File senario in my sandbox, let me know how to do this senario and also what are the software i have to load in this standalone system.
         plz send me related doc's.
    regards,
    Phani

    HI,
    First check JDBC is in Adapters list or not , if not try to install..
    Next check what is the Database you are trying to connect,
    The respective driver parameters and the connection parameters are to be selected and the respective database is existed or to be created and create the table also .
    Now use the scenario to get the data from the table and send to file as your requirement
    see also the below links
    Sender JDBC scenario - /people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
    /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    also
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 - File to JDBC
    /people/siva.maranani/blog/2005/09/16/xi-how-to-on-jdbc-receiver-response - XI: How-to on JDBC receiver response
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    JDBC - http://help.sap.com/saphelp_nw2004s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    multiple tables with JDBC  - http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    JDBC Response /people/swaroopa.vishwanath/blog/2006/12/28/send-rfc-to-sap-xi-150-asynchronous
    Receiver JDBC scenario - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20install%20and%20configure%20external%20drivers%20for%20jdbc%20and%20jms%20adapters.pdf
    Deploying and Removing JDBC Drivers
    Regards
    Chilla

  • Batch Processing of records using JDBC adapter

    Dear all,
    We are working on JDBC-JDBC scenario and the flow is as below. Source is ORACLE and Target is SQL SERVER.
    We need to pick up 2000 records from Source . PI should split them ito 4 batches of 500 each and should insert in SQL DB.While inserting the records, if there are any errors, those records should sent back to Source again. It is Synchronous scenario.
    1) But as far as I know Batch Processing mode, INSERT option cannot be used.(From SAP help)
    2) Will the connection break if we are sending the error records back to sender.
    Any thoughts would be helpful.
    regards,
    babu

    Hi,
    The below links may help U.
    JDBC ADAPTER
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 - File to JDBC
    JDBC - http://help.sap.com/saphelp_nw2004s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    multiple tables with JDBC - http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    JDBC Response /people/swaroopa.vishwanath/blog/2006/12/28/send-rfc-to-sap-xi-150-asynchronous
    Regards
    Pullarao

Maybe you are looking for