Update in JDBC-Adapter (Send)
Hallo,
I´m trying to execute a Update in the JDBC-Adapter (Sender). When a Select-Statement results in exactly one entry back from the data-base I wont to Update this entry.
How refrencing to the enty (for example by an primary key)? I found only documentation for Receive-JDBC-Adapter...
Thanks in advance,
Frank
Hi Frank,
At last I get your scenario..
One solution to your problem can be the following though i am not sure if this is a perfect soultion or a viable solution but, it is a workaround solution which you can surely try.
1. To update the status of your database on the basis on the events that have taken place, you can configure a JDBC Adapter as a receiver.This JDBC adapter will contain the event and the flag value as well as Update condition.
Just check this blog and SAP help to understand how JDBC receiver adapter works,
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
2. In your JDBC sender adapter that is polling over your DB table, you can give the value for UPDATE as <test>. This means that you are not changing anything even after the adapter has picked up intfo from the table. Ofcourse, you would have to increase the polling interval time as the JDBC receiver has to update the DB.
I know this solution is a long shot and an added headache but if nothing works out, you can always do it this way.
Hope this helps,
Regards,
Bhavesh.
Similar Messages
-
How to configure JDBC Adapter(Sender & Receiver)
How to configure JDBC Adapter(Sender & Receiver)
Rgds
RuchithaHi ruchitha thakur ,
These r the following web-sites which give u detailed information about configuring of JDBC Adapter(Sender & Receiver)
JDBC is a technical Adapter provided by SAP.
Configuring the Sender JDBC Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/content.htm
Configuring the Receiver JDBC Adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d36d51d-0b01-0010-b3aa-9cb313b63cf4
SAP XI Utilize SAP Adapters to connect to heterogenous systems
https://wwwn.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3fc4bd90-0201-0010-68bd-ab931b06f9c2
cheers!
gyanaraj
***Pls reward points if u find this useful -
JDBC Adapter - Sender - Stored Procedure - SQLException Error
Hi,
I have created one stored procedure in our Oracle database. I give below that stored procedure.
CREATE OR REPLACE PROCEDURE sp_stud
IS
l_row student%ROWTYPE;
TYPE t_ref_cursor IS REF CURSOR RETURN l_row%TYPE;
c_cursor t_ref_cursor;
BEGIN
OPEN c_cursor FOR
SELECT *
FROM student where readflag= ' ';
LOOP
FETCH c_cursor into l_row;
EXIT WHEN c_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(l_row.id || ' : ' || l_row.name);
END LOOP;
close c_cursor;
END;
This is a procedure to retreive rows from the table student which is having the field read_flag = ' '; (Student table contains the fields ID, NAME, BIRTHYEAR, BIRTHMONTH, READFLAG).
In JDBC Sender Adapter, I set the values for the following fields under Parameters tab.
Query SQL Statement: EXECUTE sp_stud
Update SQL Statement: UPDATE student SET readflag = 'Y' where readflag = ' '
The scenario is every 5 minutes JDBC adapter checks the table whether any new row is inserted, if it is inserted and commit, it will send that record to File. This is the Scenario.
In Runtime Workbench, Communication Channel Monitoring, it shows the following error, when JDBC Polls the table.
Database-level error reported by JDBC driver while executing statement 'EXECUTE sp_stud'. The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-00900: invalid SQL statement '. For details, contact your database server vendor.
Note : If we execute the Stored Procedure ad SQL command level, it works fine.
Kindly help friends to solve this, where the error is happened.
Thanking you,
Kind regards,
Jegatheeswaran P.Hi,
Not a Database expert. But , in case you have not seen the note pointed by Deepu,
<i> The JDK 1.1.x, 1.2 and 1.3 versions (classes111. zip, classes12.zip, classes12.jar) of the driver are not compatible with the SAP XI JDBC Adapter. Use the JDK 1.4 driver (ojdbc14.jar) instead. For details, refer to Oracle MetaLink note # 203849.1.
<b>Invoking Oracle stored procedures from within a JDBC sender channel is only possible for Oracle DBMS versions >= 10.2.x using so-called table functions:</b>
Example:
pkg1 -
CREATE PACKAGE pkg1 AS
TYPE numset_t IS TABLE OF NUMBER;
FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED;
END pkg1;
CREATE PACKAGE BODY pkg1 AS
-- FUNCTION f1 returns a collection of elements (1,2,3,... x)
FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED IS
BEGIN
FOR i IN 1..x LOOP
PIPE ROW(i);
END LOOP;
RETURN;
END;
END pkg1;
pkg1 -
<b> This function has to be invoked from the sender channel configuration (SELECT statement) as follows:
SELECT * FROM TABLE(pkg1.f1(5));</i></b>
Check this, confirm your Oracle DB version and then use the Table Functions as described in this note.
A Database Expert wil be able to crack this for sure.
Regards
Bhavesh -
[Help]JDBC adapter- sender/receiver
Hello Gurus,
I have a scenario but can not find a solution.
We have a ECC and a database.
The scenario is to run a report from ECC, sending the selection criteria to the database, and get the result from the SQL statement.
How can i configure in PI?
Thanks a lot in advance!
Best regards,
CharlieHi,
This can be done using sync client proxy call.
On the ECC side we need to make a sync call to PI using client proxy, the input parameters to this proxy will be the
selection criteria, on the receiver side in PI use JDBC adapter.
For receiver side use the data type for "Select" statement :
(http://help.sap.com/saphelp_nw70/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm)
and in mapping use the values received from ECC and map them as <key> elements.
The returned value will be part of the output parameters of the client proxy.
Pravesh. -
JDBC ADAPTER SENDER ORACLE7.2.3
HI ALL,
We have to read data from an Oracle 7.2.3, but we are having problems In the inbound payload I can see that we have the data but is not building the xml properly, because the tags are empty. Someone haa experiencied this issue before?
Many thanks in advance!
Regards
NoeliaHi Mario,
the SQL is correct. I have checked it in Toad. I thinks this is something relative to the driver for oracle, because the jdbc adapter recover the data of the query but the info that I can see in the payload is the following:
<ns:MT_XXXXXX xmlns:ns="http://XXXX.es/xi/XXX">
<row>
<b><></b>123<b></></b>
<b><></b>PEPITO<b></></b>
<b><></b>01/01/2006<b></></b>
</row>
</ns:MT_XXXXXX>
And thats drive me to think that this is an issue with the driver, but Im not sure.
Any idea?
Many thanks
Regards
Noelia
Message was edited by: Noelia Fernandez -
How to update row by row in Jdbc Adapter sender ?
Hi friends ,
No i am reading data from a table using select query and resulting data i am keeping in the FTP folder as XML File.
I want to
1. to know how many rows i read ?
2. Update the read completed time in each row of the sender side table .
( I am using <b>select * from a table where tag='n' </b> . I am giving this in <b>Query SQL Statement</b> of JDBC Sender adapter processing parameter .
I am writing update query as update table set tag='y' where tag='n' .
Will it perform row by row ?
3. Insert in to another R3 System table the rows which i read as a log .
Can you please give procedure to do that .
Expecting your reply asap .
Thank you
Best Regards.,
V.RangarajanHi raj ,
Thanks for ur reply . I am new to xi . Just i am doing a scenario . I can able to read the ms-sql server table data using jdbc Sender adapter .
Can i use RFC Adapter to insert the values to R3 table ?
If i have mapped to rfc fields will it store into the table once we read the data from ms_sql server table using select query of JDBC Sender Adapter ?
Best Regards
V.Rangarajan -
Useing a Idoc an Oracle database Can be update useing JDBC Adapter
Hi Guys,
Can you help me on the above topic..
Regd's
RajHi Raj,
You can use the Idoc Adapter on the sender side and JDBC on the reciever side. After you have configured your scenario, you should be able to write data into the oracle database.
For the strucutre of your Datatype for insertion , just check this link,
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
To access any Database from XI, you will have to install the corresponding Driver on your XI server.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10
Or on the JDBC end you can write a stored procedure to make your data update more efficient.
Go through this blog for stored procedures.
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
I hope this helps.
Regards,
Abhy -
JDBC Adapter Sender How to delete 3 tables?
Hi all, I need to delete records of 3 tables after the Communication Channel send the information.
The problem is I want to put the 3 sentences in the Update SQL Statement separated with ";" but it does not work.
This is my statement
DELETE from table1 WHERE field1='3';DELETE from table2 WHERE field1='3';DELETE from table3 WHERE field1='3';
This is the error in the Runtime Workbench.
Database-level error reported by JDBC driver while executing statement 'DELETE from pruebas.SAPRCTGH WHERE DGHSTS='3'.'. The JDBC driver returned the following error message: 'java.sql.SQLException: Token . was not valid. Valid tokens: <END-OF-STATEMENT>.'. For details, contact your database server vendor.
When I tested from Razor SQL it works fine, I do not know what more to change.
Regards,
Sebastián AlvarezHi all.
Thank you very much for your answers.
I'll try one thing, I'll create another Service Interface and in the Configuration Scenario create another Receiver Agreement, so the message will be sent to ECC and will "return" like inbound to delete the tables with 3 delete statements.
Thank you very much to all of you.
I'll try this and I'll tell you
Regards -
Xi JDBC Adapter - Query SQL Statement & Update SQL Statement
Hi!
I configure the JDBC adapter sender (XI) to take data from Oracle database.
I set the Query and Update SQL Statement in the Processing parameters of the communication channel in this way:
Query SQL Statement :
SELECT * FROM XI_TABLE WHERE STATUS = 'WAIT' ORDER BY ROW_NUM
Update SQL Statement :
UPDATE XI_TABLE SET STATUS = 'DONE', DATE = SYSDATE WHERE STATUS = 'WAIT'
My question is :
If a new record with the field STATUS = 'WAIT' is added to the table (xi_table) during the time between the execution of the query statement and the start of the update statement, what will happen to that record during the update?
There is a way to avoid the update of that record? or to pass to the update statement only the record selected in the query statement?
Please, may you give me some example?
Thanks,
Francescohi,
did you check "Isolation Level for Transaction"
for the sender jdbc adapter?
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
Regards,
michal -
Sender JDBC Adapter and Synchronous Interfaces
Hello
I have a Oracle/JDBC -> XI -> ECC/RFC scenario. The communication mode is Synchronous.
In the Oracle database I have a table with a "STATUS" field. When JDBC Adapter Sends the rows from this table to the Integration Engine, it updates the "STATUS" from "G" (GENERATED) to "R" (READ).
The response from the RFC contains for each row sent to RFC a "STATUS_from_RFC" field, that I would like to use to update Oracle STATUS field to "S" (SUCCESS) or "E" (ERROR).
Can the Sender JDBC Adapter use the response from the Synchronous RFC to update Oracle "STATUS" field itself ?
Or do I need a Receiver JDBC Adapter? In this case, I have to use asynchronous communication and BPM, ok ?
thanks
JulioBhavesh,
<i>>>>But, the online help states it supports QOS of BE and so it does support Synchronous Processing.</i>
Even File adapter has QOS of BE
To my understanding response back is possible only if it is PUSH + Sync
Adapters PUSH + Sync
HTTP
SOAP
RFC
XI
etc...
For the above response is possible
Adapter PULL + Sync
File
JDBC
etc..
In general there can be a response if there is a request. In the case of File and JDBC there is no request message coming to the adapter, its the adapter which is actually requesting.
This is just an idea and my understanding.. might not be true If possible do try it and let everyone know I will also give it a try when time permits
Thanks,
Prakash -
Sender JDBC adapter...problem
Hi,
the real problem is Sender JDBC adapter sends data in following format.
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
<row>
<Associate_ID>16444</Associate_ID>
<Associate_Name>Sudhir</Associate_Name>
<Status>false</Status>
</row>
</resultset>
But in Design time mapping...structure of source message will be like
<?xml version="1.0" encoding="UTF-8"?>
<ns5:DB2File_DB_MT xmlns:ns5="urn:db2file">
<Resultset>
<Row>
<Associate_ID>16444</Associate_ID>
<Associate_Name>Sudhir</Associate_Name>
<Status>false</Status>
</Row>
</Resultset>
</ns5:DB2File_DB_MT>
How does this tag ... <ns5:DB2File_DB_MT xmlns:ns5="urn:db2file"> get generated in runtime
and apart from 1 to 1 mappings b/w the three fields above in the row tag...wt other mappings to be performed
Pls help...
SunitaHi Sunita,
what i understood from your query is namespace tag is coming while message mapping. This namespace can be avoided in the message type if you keep the XML namespace field empty while creating message type. But i afraid you have to do the message mapping again.
Regards,
Satish -
Using Stored procedure in sender or receiver jdbc adapter
Hi All,
Please let me know simple blogs for Stored procedure used in sender or receiver jdbc adapter to get data from 2-3 tables
ThanksHi
To work with Store proceudres (SP) you have to create the SP's in database like Oracle, Mssql or Msaccess.
Ususally the SP creations are done by database experts. For more info about "SP" try Googling!
The below blog is about SP but not the one you expect!
/people/itisha.alok/blog/2009/03/23/jdbc-stored-procedure-returning-multiple-resultsets
Executing an Oracle Stored Procedure from Sender JDBC adapter
Sender Adapter - -
SP will contain the select Query alone or with it will contain insert, delete statement too.
Receiver:
SP will have insert or delete satement.
Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
The below details are required to configure the adapters
Driver details
database name
Procedure name
user name
password,
Regards
Ramg -
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 -
How many records does JDBC adapter can obtain in one polling?
Hello everybody,
I need to do an interface between legacy system and SAP ECC, the legacy systems have a DB so i use the jdbc adapter (sender) and receive the information to SAP ECC with proxy, so i need to activate the polling option from my jdbc adapter working as a sender, i read a table with lot of records, and i need to know how many records does jdbc adapter support when the polling is executed, because is necessary read all records from the table and change the status of the processed field.
Is possible to get all the records from that table in one polling interval (50,000 records aprox)?, or i need to do the polling by blocks of records until finish all records from the table?, the second option, i dont have idea how can i do it.
Regards,
VicmanHi again!,
i still working on that, but i have a question, is possible to handle Store Procedure in jdbc adapter?? is supported?, like PL SQL, because i was working in the next query but i don't know if it works and where do i need to locate the query in the Query SQL Statement or in Update SQL Statement field or both? but how?.
DECLARE c_cursor CURSOR FOR
SELECT * FROM tablename
WHERE processed=0
OPEN c_cursor
FETCH NEXT FROM c_cursor
WHILE @@FETCH_STATUS = 0
BEGIN
update tablename set processed=1
FETCH NEXT FROM c_cursor
END
CLOSE c_cursor
DEALLOCATE c_cursor
Regards, -
Stored procedures and JDBC Adapter
Hey guys ,
any blog where i canlook up w.r.t. working with any stored procedure through xi ?
Appreciate ur help.
KrishnaHi Krishna,
Here you go-
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
Also remember that, Sender JDBC Adapter doesnot support Oracle Stored Procedures. Because Sender JDBC Adapter sends resultset to XI. But Oracle stored procedure returns Cursor.
I think, if you are using other database then it may support.
Regards,
Moorthy
Maybe you are looking for
-
Inventory count w/o reference doc "MI09" with IDoc WVINVE02
Dear forum, I am trying to create an inventory count without reference to a document and I thought I would use IDOc WVINVE02 with message code WVINVE. We don't have an SAP inventory document, but would like to use just an external reference. When run
-
I created a form in formcreator but i need to make edits in adobe professional.
can i save the form as a pdf, print it to pdf, save the file as something else or import part of the file?
-
I'm arpeggiating A minor over a number of octaves and I want to switch to D minor before the cylce is over. However, I want the d minor to start from the lowest note that I'm playing as if it were a new cycle. What it does instead is continue the cyc
-
How can i work jsp with ms dos
i want to send a form to particular person ,where that particular person have selected in the form,if the particular person has logged-in in the Window NT4.0, then he should receive the message like, u hava a msg from so and so person etc. that messa
-
I just added songs from my computer to my itunes. The songs are showing in the library but Im unable to play them. The 'copying 1 of 50' bar froze and so did the analysing artwork. iTunes hasnt been closing properly too, I have re-downloaded iTune