JDBC Sender Adapter - Restrict number of rows fetched, Oracle
Hi,
Is it possible to restrict the number of rows fetched by the JDBC Sender adapter at each run? What would the appropriate Select and Update statements be to make sure a limited number of rows are selected and flagged as processed?
We are connecting to a Oracle RDBMS.
//Johan
hi,
have a look at this info:
about oracle and limiting number of rows
http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
Similar Messages
-
JDBC Sender Adapter - NOT FETCHING RECORDS...
Hello Experts,
I know this was answered in a separate thread (JDBC Sender Adapter - NOT FETCHING RECORDS -PROCESSING STARTED).
However, my question is, Is there a way that we can be notified if a channel has stopped fetching records?
or is there a reporting tool that can be used to check/monitor if a channel is not processing any messages?
Thanks & Kregards,
allarHi Sreedhar,
Thanks for your reply.
These case is not being captured by our alert configuration because its not throwing any error.
in the communication channel monitoring, we see only something like this..:
3/16/09 8:25:19 PM Processing started
3/16/09 8:34:20 PM Processing started
3/16/09 8:33:55 PM Processing started
3/16/09 8:32:54 PM Processing started
but no error is being displayed nor sent.
Also, there was a case that the channel just stopped fetching, even though everything is active.
example log:
3/12/09 8:32:54 PM Processing started
We're looking for ways on how we can trap these scenarios as early as possible, get us notified and perform adapter-lock release when needed.
Regards,
allar -
How to notify in case SQL query(JDBC sender adapter) does not fetch records
hi,
How can we notify(by alerts or something) in case SQL query(JDBC sender adapter) does not fetch records? In channels logs it only says processing started & finished(no message is created for same).
Thanks,
MayankHi,
1 ) What is exact audit log message ?
2) Try fetching the count in SQL statement if there are any valid records it will give the count.
May for testing you can use <TEST> in update statement.
3) Have you used taskTimeout parameter ?
4) Are multiple channels polling on same table ?
regards
Ganga -
JDBC Sender Adapter - NOT FETCHING RECORDS -PROCESSING STARTED
Hello all,
I have set up a JDBC sender adapter .With polling interval as 30 Seconds. Polling is done successfully
but it does not fetch the records .
Valid Data is present in the tables.In the Communication Channel Monitoring log shows :
"Processing Started"
after each poll interval.
Adding to this , it was working fine with the same parameters two days back.
I have enabled the Driver Trace but didnot get any information from Trace.
How to resolve this issue?Any help
Regards
Ganga PrasadHello maheshwari,
Valid Data is there & many records are there to be fetched.
One more thing Normally in the Communication Channel Monitoring
for an JDBC adapter even if there are no records to fetch we get the Log information in detail that :
Polling interval started.
Processing finished successfully
Processing started
Polling interval started.
Processing finished successfully
Processing started
But here in my case am getting only : (polling interval : is 60 Seconds)
2/5/08 8:29:19 AM Processing started
2/5/08 8:28:19 AM Processing started
2/4/08 3:34:54 PM Processing started
2/4/08 3:33:54 PM Processing started
One more observation is that my poll interval is 60 seconds but now it is polling after every 120sec
2/5/08 11:17:31 AM Processing started
2/5/08 11:15:31 AM Processing started
2/5/08 11:13:31 AM Processing started
2/5/08 11:11:31 AM Processing started
I have tried refreshing Cache but no change .
Regards
Prasad -
JDBC sender adapter - 3 calls in PO 7.4
Hi Experts,
I have a scenario to fetch database records from ORACLE database using SAP PO 7.4 - JDBC adapter
There are 3 calls to make in order to fetch the data
a) Call a procedure before the fetch
b) fetch the record
c) Call another procedure after the fetch
How can we achieve this ?
thx
mikeHi All,
I am opening this up for a follow up qs on this topic. Is it true that we can't directly invoke a stored procedure from PI 7.4 sender JDBC adapter for retrieving data from ORACLE DB and we have to rely on table functions.
I was looking at some blogs on sender JDBC stored procedure calls for SAP PI 7.1/7.3/7.4
Executing stored procedure from Sender adapter in SAP PI 7.1
Oracle Table Functions and JDBC Sender Adapter
And the note Michael was referring to 941317 - XI / PI JDBC Adapter: Known Problems / Incompatibilities has the following piece of code for invoking a stored procedure from a package function returning collection of elements.
---------- 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 ----------
This function has to be invoked from the sender channel configuration (SELECT statement) as follows:
SELECT * FROM TABLE(pkg1.f1(5));
If I can't call stored procedure directly from PI sender JDBC adapter in 7.4,
I have to ask the Oracle DB guy to write a stored procedure which wraps all 3 procedures into one and again wrap it up using the package functions as well if required. So, please let me know.
thx
mike -
JDBC Sender Adapter - Records sent one at a time
Hello everyone,
Here's a summary of my scenario JDBC > XI > RFC.
My select statement (JDBC) looks like this:
SELECT * FROM BATCH WHERE STATUS='Y'
The problem is, whenever it returns multiple rows, the RFC can only accept one record at a time (1...1), so I need to pick up the records from the DB and send them one at a time.
Currently, this is how the output XML looks like:
<?xml version="1.0" encoding="utf-8" ?>
<ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
<row>
<number>200000000472</number>
<status>Y</status>
</row>
<row>
<number>200000000473</number>
<status>Y</status>
</row>
<row>
<number>200000000474</number>
<status>Y</status>
</row>
</ns:SQL_RESP_MT>
Instead, I need each row to be picked up and sent one at a time.
<?xml version="1.0" encoding="utf-8" ?>
<ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
<row>
<number>200000000472</number>
<status>Y</status>
</ns:SQL_RESP_MT>
<?xml version="1.0" encoding="utf-8" ?>
<ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
<number>200000000473</number>
<status>Y</status>
</row>
</ns:SQL_RESP_MT>
<?xml version="1.0" encoding="utf-8" ?>
<ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
<number>200000000474</number>
<status>Y</status>
</row>
</ns:SQL_RESP_MT>
Does anyone know the changes I need to make in my current SELECT statement or the JDBC Sender Adapter to make this possible.
Thanks in advance!
GlennThank you all for your replies. I'll check out your link in a bit, Phani. Thanks!
A SpliByValue won't work since the BAPI Header is (1...1).
Luckily, during testing, I found out that the BAPI (BAPI_PRODORDCONF_CREATE_TT) handles multiple lines in one of the subelements of the header so that was where I mapped the Rows.
I might need to trigger multiple BAPIs in the future, so I'll take a good look at your suggestions, but for now, I'm marking this question answered.
Warm regards,
Glenn -
JDBC sender adapter outofmemory error
Dear friends,
We are getting following error on JDBC sender Adapter: Error during conversion of query result to XML: java.lang.OutOfMemoryError: Java heap space (failed to allocate 1073741848 bytes)
I have read blogs where there have been suggestions to limit the amount of data picked by using WHERE condition and not using SELECT *
In our scenario we are creating GL IDOCs . In SQL when PI picks it up it needs to get all the corresponding Header and line items together. We cannot randomly pick 1000 records at a time. The SQL table has 500,000 rows in the following format
H H H L1 L1 L1
H H H L2 L2 L2
H H H L3 L3 L3
H1 H1 H1 L1 L1 L1
H1 H1 H1 L2 L2 L2
H1 H1 H1 L3 L3 L3
Please let me know how can we solve this issue?
Thank you,
Teresa
Edited by: Teresa lytle on Sep 27, 2011 3:13 PMIf you are using oracle database, uses ROWNUM field to fetch first set of records and you can update those records with the flag as true.
similarly If you are using MS SQL database, uses SELECT TOP command to fetch first set of records and you can update those records with the flag as true.
Like File/FTP adapter, the next poll interval would be as scheduled. The Administrator can then alter the table contents, to ensure lesser no of records are picked up.
Here You need to limit the no of rows if you again face the problem. Please chec the SAP Note
https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1296819 -
JDBC Sender adapter - message split
All,
Scenario:
Oracle Stage table - PI - ECC or R3, (depending on a particular value the record goes to ECC or R3 to post a transaction).
After the record is picked, flag is updated and depending on posting the transaction on SAP, the flag is updated in the stage table.
With the JDBC sender adapter, multiple records are picked up depending on the select statement in the sender comm channel.
I have the following rek.
Now the message is in the AE, before the message enters IE, I would like to split the messages
This would help me in resubmitting the failed (failed to post the transaction) records.
Is there any way that I would be able to do it?
Any guidence...
regHi Naveen,
An alternative way , instead of splitting the multiple record being picked up in a single poll, you can control the number of records being picked. By using the following statement in the sender cc
SELECT * FROM .... UPTO ROWS < 20
so that only 20 records are picked at a time. and resubmit the set of 20 in case it fails.
You can go for this method if it suits your requirement.
Regards,
Shamly -
Challenging issue with JDBC sender adapter
Hello Guys
I have this requirement
From Oracle Database I have to read to tables one for the header and one for the detailes and map the result to one RFC.
I have only worked with one table at the time with the JDBC sender adapter but never with 2 tables
My challenges are
1 - How I can read the 2 tables at the same select statement , I suppose I have to use a join with 2 identical fields , so far so good ,but how I can handle multiple records
suppose the result is 10 new different records which each of the recored has to be mapped to the RFC , then we will have 10 RFC calls.
how can I do the mapping in this case.
2 - How can I update the 2 tables at the samme time and flag them as processed , as far as I know we can not use 2 update statement in the same JDBC sender
any help will do
Thanks in advance.Hi
Thanks for the replayes
The RFC is used to create and Invoice Idoc , It has to be one record (Header and Item ) to one RFC.
a JDBC to IDoc can also be used , but we have to update another table in SAP that is why the RFC,
My doubt is how the Data type for the sender JDBC should look like , as mentioned I have 2 tables to fetch data from
<Invoice>
<Header> 1 -- 1
<f1>
<f2>
<f3>
</Header>
<Item> 1--n
<f1>
<f2>
<f3>
</Item>
</Invoice>
The sender JDBC returns
<Invoice>
<row>
<f1>
<f2>
<f3>
</row>
</Invoice>
How can I replicate the data type to meet the JDBC sender structure.
and regarding the mapping do I have to change the occurrunce to 0 -- unbounded
regarding the update Ragu is right in his suggestion
Table1 can be used as primary table, Table2 can be used as Secondary table.. u will have key field to link both table.
So Just Updating only Primary Table(Table1) will helps on this.
Thanks. -
JDBC Sender Adapter - Single Select and Single Delete
Hi,
I have the requirement where I have to select the single row (or 1st row) from database through JDBC Sender Adapter and delete that record after selection in single polling.
Please help me out with proper SQL query or with any other approach.
Thanks and Regards,
VijayI think in SQL select statment you have something like Select TOP number....where number is 1,2..
The detailed syntax for the SELECT clause is as follows:
SELECT [ALL | DISTINCT] [TOP nExpr [PERCENT]] Select_List_Item [AS Column_Name] [, ...]
for more details...check out..
http://msdn2.microsoft.com/en-us/library/95c6ex88(VS.80).aspx
Document sent on your email id.
Nilesh -
How to update two tables in a single call using JDBC Sender adapter
Hello All,
The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
Update Statemtent: We can only update one table using this statement.
Is it possible to update two tables using the Update Statement without using Stored Procedures.
Let me know.
Regards,
Sreenivas.Hi Sreenivas,
> Is it possible to update two tables using the Update Statement without using Stored Procedures.
Yes its possible through join statement
Check this links
Update in JDBC Sender adapter for more than one table
data from 2 tables for jdbc sender adapter
Regards
Ramesh -
Hi everybody
I have the following error in my JDBC to JDBC scenario; I configured the JDBC sender adapter and receive the following message back. In the Configuration I set Document Name to MT_ScanningStatus:
<?xml version="1.0" encoding="utf-8" ?>
<MT_ScanningStatus>
<row>
<ScannerNb>1</ScannerNb>
<Status>0</Status>
</row>
<row>
<ScannerNb>2</ScannerNb>
<Status>2</Status>
</row>
<row>
<ScannerNb>3</ScannerNb>
<Status>0</Status>
</row>
<row>
<ScannerNb>4</ScannerNb>
<Status>2</Status>
</row>
</MT_ScanningStatus>
I defined the corresponding datatype as follow:
DT_ScanningStatus Complex Type
row Element 1...unbounded
ScannerNb Element 1
STatus Element 1
In the following Mapping I tried to Map this structure to the Structure used to send an Update SQL Statement to the JDBC Receiver to update the same table. A normal Test in the Mapping Tool runs fine but when I enter under source the above incoming Message from the JDBC Adapter I got the following error. I think the incoming message cannot be interpreted. Can someone support me? I read the documentation for the JDBC adapter and also a lot of weblogs and discussion threads. Maybe someone knows a weblog describing more detailed the sender adapter and how to handle the incoming Message!!
Thanks in advance Oliver
14:58:03 Start of test
Compilation of MM_JDBC_to_JDBC_test successful
Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:130)
at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
Root Cause:
com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)(:main:, row=1, col=8) -> com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:2009)
at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2657)
at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713)
at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245)
at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276)
at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338)
at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128)
at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128)
at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
Caused by: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:2009)
at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2657)
at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713)
at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245)
at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276)
at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338)
at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125)
... 3 more
Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)Hi Oliver,
>>>>source the above incoming Message from the JDBC Adapter I got the following error. I think the incoming message cannot be interpreted.
do this:
in the test tab try your mapping once more
(the correct one)
then save the source xml as file
next compare this saved file with the one
you get from the jdbc sender
>>>>>Declaration not allowed here.(:main:, row:1, col:8)
and compare the first lines in those two XML files
are they the same?
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
JDBC Sender adapter - can VIEW be used in Query statement
Hi,
In JDBC Sender adapter, can we use a VIEW sql query in the "Query SQL Statement" placeholder?
For eg:
CREATE VIEW <view name> as SELECT * from <table name> WHERE <condition>
instead of the usual:
SELECT * from <table name> WHERE <condition>
Thanks,
VishakHi
What exactly is your use of creating a view, if you are going to fetch data from different tables, then you can use the view through stored procedures.
Hope this clears your doubts
Thanks
Saiyog -
JDBC sender adapter, ...Processing parameters, Update SQL statement
in JDBC sender adapter, ...Processing parameters, there is an Update SQL statement field, can u tell me ...why this is required,,,,,and in one of the example scenario...it was given as <TEST>..
Sudheep,
In the sender JDBC adapter you have the select query to select data from the database.
Let us summer 2 cases,
1. You have <test> in the UPDATE . In this case, during every polling interval the JDBC adapter will end up selecting the same data from the Database. This would not be needed in most f the cases. Why would you want to select the same data over an over again?
2. If you have an update Statement in the Update field you can make sure that the data selected in the selected statement is updated so that the same rows are not selected again.
Take a look at this blog,
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
Regards
Bhavesh -
Hi,
Scenario: JDBC-XI-R/3
I am trying to run the JDBC sender adapter every 3 minutes based on the poll interval to select rows from Oracle db.
In the select and update statements when I use the rownum < '11' and flag condition (Y or N), then I see XI is picking up 10 rows in a two times and I see two parallel processes in SXMB_MONI.
I want XI to run only pickup 10 rows for every 3 minutes and update only 10 rows in Oracle to "N" from "Y".
When I take out the rownum condition from update I do not see this issue.
<u>Update statement:</u>
Update <TABLE> set status_flag = 'N' WHERE status_flag = 'Y' and rownum < '11'.
Can some body point me in the right direction ?
Thanks
SteveHi there,
See if this works. Though I never came across such a scenario, I can think what to be done in this case.
Create a staging table as same structure as from where our JDBC adapter is picking up the data currently.
Whrite a tigger(after delete) on staging table to call a stored procedure.
stored procedure will select the data from source table and insert them in to staging table (rownum<11) as well as update the flag column in source table.
Now load the staging table initially from source table with only 10 rows (one time process). Configure your JDBC adapter on staging table. In update sqlquery field of JDBC adapter write delete statement for all the data from staging table to be purged, as there will not be more than 10 rows at any time and after each time the adapter supplied Delete statement will purge the data so you dont have to worry about selecting 10 rows or updating 10 rows from JDBC adapter. As every time the trigger after delete statement will fire and load only 10 rows from source marking those 10 rows as read_already status.
NOTE: for Calling stored procedure from trigger follow your database SQL reference documentation.
Thanks.
-Nilkanth.
Maybe you are looking for
-
WRP1 excluding open POs based on doc type
Hi friends, We are using SAP IS Retail ECC 6.0 In our business, we are having requirement that Open PO quantity of particular document type (eg ZNBA) should be excluded from the WRP1 requirement calculation. Eg: For an article 100001, Site A001, foll
-
How to create a filter based on Effective date EFFDT
Hello to all, I am currently creating reports from an HR database that stores records by employee (EMPLID) based on effective date(EFFDT) and Effective Sequence (EFFSEQ). It is easy to get a report that shows all entries up to a certain data (using <
-
Windows 8.1 and iTunes 11.1.4.62 iPhone Backup Lost
I synced my iPhone 4 yesterday, then reset it to factory settings. I have done this several times, and everytime I am able to restore my iPhone from backup. However, that was on Windows 7 and earlier iTunes versions. This time, with Windows 8.1 and i
-
SSD drive filling up due to video rendering?
Hi. Apologies for what will no doubt be a stupid question but I'm not as computer savvy as many of you here. Basically I film ice hockey games for my local team and produce weekly highlights for YouTube. I edit the footage using Premier Pro CC and th
-
Webcam with emesene 1.5
emesene 1.5 have been launched recently with experimental suppor for webcam... I don't have cam but I have tried to receive a cam in a conversation with a offical MSN peer.... but with no success. Does anybody know how to configure it to receive vide