Update sentence in JDBC SENDER
Hi mates,
I have a doubt about a sentence update in JDBC SENDER adater.
This update we apply, is from all the Database or from de Select we do??
Thanks a lot
Hi,
The databasename is specified in the connection string. The update statement will have scope of only this database.
Ideally the update statement should have the same where conditions as the select statement, so that exactly the same records are updated which are selected.
To be doubly sure of the sync between select and update statements check the DB issolation level parameter in JDBC sender adapter.
Hope this helps.
Regards,
Siddhesh S.Tawate
Similar Messages
-
Execution time difference between SELECT & UPDATE statement in JDBC Sender.
Hi Experts,
In my scenario, I have used the JDBC Sender Adapter with the SELECT and UPDATE statement.
Now the problem is in between the execution of Select and update statement, few more entries are coming in the same DB Table.
So result of this is updation take place for those entries which are not even picked up by the select statement.
Can we avoid this execution time difference between the SELECT & UPDATE statemet on JDBC Sender side???
Thanks & Regards
JageshHi
Use serializable option in additional parameters, now all new entries would also be updated. -
WHEN DOES UPDATE HAPPEN IN JDBC SENDER Adapater
Hi folks ,
I am using jdbc sender adapater to call RFC function and the o/p pf the RFC i am writing to the file
This is my select query
SELECT * FROM ULIDTA2.F5631505 WHERE QSINTF='N'
and mu update query is
Update ULIDTA2.F5631505 set QSINTF='Y' where QSINTF='N'
now the slect returns multiple rows and i want the rfc to be called depending on the number of rows i get 4m select . but wht is happening is i find that seleect picks the first row calls the rfc writes to the file and updates the query .
hence other rows are not able to be processed .
does jdbc sender update as soon as it picks the select query . how do i update one row at a time .
thks
amitHi Amit,
I dont think one row at a time is possible with the SELECT query as the JDBC adapter is going to return all the rows that satisfy your query.
One work around would be to develop a Stored Procedure in your Datbase, and then use the same Stored Procedure as your select query. Now, tits the task of the stored procedure to make sure only one row is selected at a time.
Just look at Query SQL Statement part ubnder this link,
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
Regards,
Bhavesh -
Update- statement in JDBC sender Adapter
Hi ,
I have a requirement where I am trying to fetch data from ODS based on some flag and immediately I want to update the flag status . So I used selected and update in JDBC sender adapter .
But I have one question , in the small timeframe where XI has done a select and just before XI could issue the update statement if a new record is added to ODS . Then that new record will also get updated though it wasnot selected in select statement .
Can someone let me know how to overcome this problem ; as I want to make sure I update only those recrods which are selected in select statement ??
Thanks & Regards,
SuvarnaHi,
Check out the following thread. It gives the exact answer to this question.
JDBC Sender Update Query
One of the replies in the above thread:
I put in an OSS note asking this exact question with your specific example, and got a reply. I was referred to OSS note 0000831162, where it is explained very unambiguously that the SELECT and UPDATE queries are run in the same transaction.
Regards,
P.Venkat
Message was edited by:
Venkataramanan -
Regarding Update querry at JDBC Sender adapter
Dear all
need you help for this requirement
My Select statement is working fine where flag column has some time null value
below is the Select statement and ( EMP_MAXQTY_AUTH_FLAG is Flag field here & EMPLOYEE_MST is table name)
SELECT EMP_ORG_CD,EMP_CD,EMP_NAME,EMP_STATUS,EMP_MAXQTY_AUTH_FLAG FROM EMPLOYEE_MST WHERE EMP_MAXQTY_AUTH_FLAG<>'Y'or EMP_MAXQTY_AUTH_FLAG is null
but update querry is as given below
UPDATE EMPLOYEE_MST SET EMP_MAXQTY_AUTH_FLAG='Y' WHERE ((EMP_MAXQTY_AUTH_FLAG <>'Y') OR (EMP_MAXQTY_AUTH_FLAG is NULL))
Please suggest the exact query
if Flag row ahs some value any thing it is updating , but when there is NULL value ,
problem is coming
Please help.....
Regards
PriyaHi Priya,
I think it is the mistake in query:
SELECT EMP_ORG_CD,EMP_CD,EMP_NAME,EMP_STATUS,EMP_MAXQTY_AUTH_FLAG FROM EMPLOYEE_MST WHERE EMP_MAXQTY_AUTH_FLAG'Y'or EMP_MAXQTY_AUTH_FLAG is null
means select all record whose *EMP_MAXQTY_AUTH_FLAG is 'Y' or Null *
UPDATE EMPLOYEE_MST SET EMP_MAXQTY_AUTH_FLAG='Y' WHERE ((EMP_MAXQTY_AUTH_FLAG 'Y') OR (EMP_MAXQTY_AUTH_FLAG = ' '))
means update those records where *EMP_MAXQTY_AUTH_FLAG is 'Y' or Null * and the new value to be updated is 'Y'
Change your update query to
UPDATE EMPLOYEE_MST SET EMP_MAXQTY_AUTH_FLAG='D' WHERE ((EMP_MAXQTY_AUTH_FLAG 'Y') OR (EMP_MAXQTY_AUTH_FLAG = ' '))
Regards
Suraj -
JDBC Sender - Different number of records selected and updated.
Hi people,
We have a JDBC -> Abap proxy scenario. The JDBC sender is pooling an Oracle database to retrieve data from a table X, each 30 minutes. The select and update statements in jdbc sender are below
SELECT FIELD1, FIELD2, FIELD3 FROM MY_TABLE WHERE STATUS = 1
UPDATE MY_TABLE SET STATUS = 2 WHERE STATUS = 1
Sometimes the message sent to Abap proxy has, for example, 400 records. Looking at runtime workbench, message monitoring, for the same message there is a log like this
Channel SENDER_JDBC_CHANNEL: Query executed successfully. Start update
Channel SENDER_JDBC_CHANNEL: 510 row(s) updated successfully
Someone has already experienced something like this? How can I handle this to guarantee to update only those read records?
regards.
robertiHi All,
Even we are facing the same problem.
In our scenario, receiver is SAPR3. (IDOC)
Will this parameter serialization work in our case?
1. SELECT XBLNR, WERKS, MATNR, MDV01, BACKFLQUANT, STATUS, SAPTIMESTAMP, PITSTIMESTAMP, PMTIMESTAMP, BATCH FROM PMBPITS.PITS_UNITY WHERE STATUS = '01' and rownum<200 .
2. UPDATE PMBPITS.PITS_UNITY SET STATUS = '02' , SAPTIMESTAMP = sysdate WHERE STATUS = '01' and rownum<200 ( currently the value is rownum < 5 )
Thanks!!
Regards
Gouri -
JDBC sender adapter: Update before mapping
Dear all,
following scenario:
in a database we have a field called "statpi". We pick all messages that have statpi = 0 and
update the data record to statpi = 1 via UPDATE function in JDBC sender adapter.
Every select statement is limited to 100 data records for each message in PI.
But if one data record is wrong and the mapping failed, of course the complete mapping failed.
My problem: The update function of the JDBC sender adapter has already updated the
data records, although they didn't have been send to target system.
What I need is following thing: The adapter should send the messages and after PI has mapped
the message and send it to target system, the UPDATE command should be executed.
In my opinion, this is only possible with BPM, but I am not familiar with Advanced mode in JDBC
sender adapter and "Transaction isolation level". Is there any workaround for this?
Thanks
Regards
ChrisStefan Grube wrote:>
> What happens, when new values have entered db meanwhile?
The job that change the DB will be fixed on a certain time. We need to configure
Availability Time Planning to be sure, that we start our select at another time.
>
> > In ideal case the data records are still in statpi=0 and get picked up after
> > the database team has fixed the problem and the adapter polls again.
>
> If the flag is not set, the JDBC adapter would poll the same data again and again.
The adapter should poll every hour. Of course we will have some errors before the
support is able to fix this problem, but because of one message each hour this should
not be the main problem.
> - You could do following: pass the values with an error flag, so you can handle this in receiver application,
I am using the function formatNumber for the field that could raised the error. But to chekc if I am able
to do a workaround here and let the target system fix the error sounds like an interessting possibility.
> - Do a split mapping and create a file where you drop any wrong lines
Also interessting. You mean that all "good" record should be mapped to struc1 and the bad one to struc2.
I am thinking of how to determine which record is wrong. Perhaps with an UDF that checks for this special
error.
> - Use XML validation in sender adpter, so the messages are not processed.
You are full of good ideas. I am not using validation yet and the mentioned field is define as string, but that
is changeable. A good possibility to check the new capability of 7.1.
> - use a stored procedure in DB whee you check data quality to send out.
not sure what this is, but I will discuss with DB team. -
Stored Procedure call from JDBC sender for Oracle Database
Hi,
I have a requirement to call stored procedure using JDBC sender adapter for retriving data from an Oracle database.
I need to execute first stored procedure call from Querry SQL statement and then trigger second stored procedure call for confirming the succesful retrival of those records from the update SQL statement.
Querries:
1. Can we trigger stored procedure from Update statement of JDBC sender.
2. Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
3. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
Please note PI does not have direct access to main table and hence the need to have separate stored procedure calls.
The PI version is PI 7.11 sp4.
Appreciate your inputs.
Thanks.
Siddhesh S.Tawate>1. Can we trigger stored procedure from Update statement of JDBC sender.
I think not possible using update statement.
> Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
Yes using select query you can call stored procedure.
>. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
No select and update handles in the same session using the same thread so if one transaction fails update should not proceed. -
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 -
Update query not working in the JDBC sender Communication channel
Hi,
We are working on JDBC to File scenario. As per the configuration, XI should pick the data from SQL database every 20 secs and should update the corresponding flag. We are using subquery in the select and update statement as both header and detail tables are involved.
Now the issue is, select query is working fine but update statement is not working as expected. It is somehow updating some other records rather than doing for the ones selected by the adapter.
Moreover logSQLstatement is also not working. Hence we are unable to identify the records which are getting updated.
Please advise.Hi Rumi,
See Question 8. Transaction Handling (Sender) in [SAP Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=831162].
8. Transaction Handling (Sender)
Q: If I have the following configured in a JDBC Sender:
Select Query:
SELECT column FROM TABLENAME WHERE FLAG = "TRUE"
Update Query:
UPDATE TABLENAME SET FLAG = "FALSE" WHERE FLAG = "TRUE"
How do I know that the JDBC adapter will not update newly added rows (rows that were
added between the time that the SELECT and UPDATE queries were executed) that were
not read in the initial SELECT query?
A: The SELECT and the UPDATE are run in the same DB transaction, i.e. both statements
have the same view on the database.
Make sure that both statements use the same WHERE clause. An additional
requirement for the correct operation of this scenario is the configuration of
an appropriate transaction isolation level on the database
(i.e., repeatable_read or serializable). You might also consider using a
"SELECT FOR UPDATE" statement instead of a plain SELECT statement to
ensure proper locking on the database. "SELECT FOR UPDATE"
is not supported in MS SQL database. In this case please make use of an
appropriate transaction isolation level on the database. For more details
please contact your DB vendors.
After, see Transaction Handling Issues in [SAP Note 1039779 - JDBC Adapter issues(Escape character,Transaction handling)|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1039779].
Best Regards.
Pedro Baroni -
JDBC Sender Adapter, Update statement
Hi ALL,
I have a JDBC to proxy scenario. We have stored procedure in the database that executess and sends the data to SAP.
Also the same store procedure updates the field Status_ID to distinguish between read and unread records. Status_ID acts as a Flag.
Now because the Stored procedure itself does what 'Update SQL Statement' in sender JDBC adapter does, what shall I put in 'Update SQL Statement' as it is not needed, but it's a mandatory field??
XIer
Message was edited by:
XIerDo you need that update in the sender jdbc adaptor to do anything....?
Dint think so..
Change your update statement to update Status_ID if its not updated..and if the sql procedure has run already then its not going to be updated ..as it already is.......
Regards
Ravi Raman -
Update in JDBC Sender adapter for more than one table
Dear Friends,
I have to select more than one table in the JDBC sender using the join condition. But i found that update statement is also mandatory in the sender comm channel. I am not going to update any flag after the select but as it is mandatory, i have decided to use the following update statement which wont effect the existing data UPDATE <tablename> set flag = ' ' where flag = ' '.
But in my case i have 3 tables, do i need to update stmts for all the three tables.
if yes how can i do the same.
plz revert back i u couldnt get the queries.
Thanks
PremHI
UPDATE T1
Set T1.flag =1
where T1.columnA=value1 and T2.columnB=value2
where T1 and T2 are tables in the same database,
and the values (value1 and value 2 ) are provided to XI by SAP based on which the flag need to be updated in T1
write a stored procedure specifying the join and call it in XI.
For doing it in SQL statement only reffer to the below link ..sur you will get help .
Multiple records update using JDBC
Regard's
Chetan Ahuja -
JDBC Sender update SQL Statement Question.
I was wondering if there is a way to have the update SQL statement line in the JDBC sender update by time stamp, this would be very helpful. Does anyone know a method of doing this?
In the SAP documentation of the adapter it has this example for using the update SQL statement after the query statement:
SQL statement for query: SELECT * FROM table WHERE processed = 0;
SQL statement for update: UPDATE table SET processed = 1 WHERE processed = 0;
What I want is to be able to put processed = (the current date) instead of processed =1 in the update statement, like this example:
SQL statement for query: SELECT * FROM table WHERE processed = 0;
SQL statement for update: UPDATE table SET processed = (the current date) WHERE processed = ' ';
I seems like you can only use a fixed value for the update statements in the JDBC Sender though, I would like to know if you can use a time stamp or variable there. -
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 -
JDBC Sender select/update problem
Hi all,
we have a serious problem. We are running the scenario JDBC>XI>RFC. In the JDBC sender adapter we do a select statement (select * from table where flag='0') and an update statement (update * from table set flag ='1' where flag='0'). Now, the problem is that when we do the select statement a third party system may insert data in the database, so the update statement updates MORE rows than the select statement has selected.
Does anyone knows a solution (or a workaround).
TIAHi peter,
can you check the transcation isolation level of your Database?
one option would be to make the database transaction such that the write transaction gets locked when even the READ is being done. So, when your JDBC is trying to select the data from the database, the WRITE will get locked and so, no entries will get selected and then, UPDATE will get executed.
Though I havent tried this, wouldnt it be possible?
Also, go through the help documentation and check the Adavanced Setting and the Transaction Isolation and see if any of the XI options can also solve your problem.
Regards,
Bhavesh
Maybe you are looking for
-
The operation can't be completed because the item "folder name" is in use
Hi everyone, I think this is quite a common issue but I don't find it really easy to find a solution. I have a folder containing a folder and no files on a server that I cannot delete, for the life of me. Whether I use shortcuts or drag the main fold
-
Need SAP R/3 4.7 Installation Guide
Guys, I need the installation Guide for SAP R/3 Installation.Please help me. I will appreciate if anyone can tell me where i can find it. Thanks in advance, Sanu
-
UME persistence error in Discovery System 2.0
We are trying to add a new user in the Portal in HP Discovery System 2.0 and we are getting the following error: "An error occurred in the persistence; contact your system administrator". Any help is appreciated. Also, this is for the Moderators - ho
-
Front Row: playing media from NAS
Dear Community Members, I use NAS (WD ShareSpace) and plan to transfer my Movies, Pictures and Music libraries to a share on the NAS. As far as I understand, Front Row can easily hadle Movies folder because it actually reads folder contents. Can you
-
Red desktop on second monitor problem
Hi,im having a strange issue with a cinema hd display set up as a second monitor on an imac, its showing the desktop fine but its all red coloured. If i connect a 17" hanns g monitor using the dvi its fine but if i connect an lg monitor that shows up