Jdbc adapter log sql statement to file
Hi,
I'm using a Proxy to Jdbc scenario.
In the Adapter Configuration the logSQLStatement is set to true.
Is it possible to log the sql statement shown in the Audit to a file?
Regards Ralf
Hi
please try the below query in Update sql statement
update table_name set fieldname = systimestamp where .....
or
update table_name set fieldname = current_timestamp where .....
Regards
Ramg.
Similar Messages
-
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 -- Update SQL statement NOT work for the last record
I'm trying to use SAP XI to send records from Oracle database to As/400 using JDBC adapter. I've defined the communication channel for sender
(1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE NOT CU_ACTION_CD='P'
(2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE NOT CU_ACTION_CD='P'
Supposed that 3 records were retrieved from (1) and successfully updated to AS/400 but only the first 2 records in Oracle database are updated according to (2)
Any advise.
PansyHi Pansy,
You select and update query is looking like wrong
kindly check below query,If you are using oracle
(1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE CU_ACTION_CD !='P'
(2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE CU_ACTION_CD !='P'
Thank you
Sateesh -
Sender JDBC adapter : Update SQL Statement : stored procedure
Hi,
Can we use a stored procedure in the sender jdbc adapter in 'Update SQL Statement'.
The problem i am facing is like, we are selecting data from two tables in 'SQL statement for query' and then in 'Update SQL Statement' , we need to delete that data from these two tables.
Please let me know if it is possible.
Thanks,
Rohityou can use a Stored procedure in the
Query SQL Statement
You have the following options:
· Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
· Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.
so have your whole select and update as part of this single Stored procedure -
JDBC Adapter - Update SQL Statement - Timestamp
Hi All,
I'm using a JDBC Sender channel to bring information from a database, when I bring the data I want to UPDATE a field inserting the date and time (timestamp) when you got the info.
Sender Communication Channel: JDBC
Query SQL Statement: SELECT * FROM PI_Factory
Update SQL Statement: ????????
Could you tell me how to do this?Hi
please try the below query in Update sql statement
update table_name set fieldname = systimestamp where .....
or
update table_name set fieldname = current_timestamp where .....
Regards
Ramg. -
Hi,
I'd like to log SQL statements using the JDBC driver logging facility.
I'm using the driver named ojdbc14_g.jar and the following properties are set:
-Doracle.jdbc.Trace=true -Doracle.jdbc.LogFile=g:\temp\jdbc.log
The JDBC driver activity is logged, but the information which is displayed is unuseful, because the SQL statements are not displayed.
Is it possible to see the SQL statements?tassoc,
I don't know how you can see the SQL statements using only the Oracle JDBC driver, but perhaps P6 Spy may be helpful for you.
Good Luck,
Avi. -
Dear all,
Is there any ways to keep log sql statement after insert,update,delete as the example below :
==========================================
user01 client01 prog01.exe update emp set name='test';
user02 client02 prog02.exe delete from emp1;
I 'm not sure.Can use trigger? Is anybody have the example code?
Oracle9i + windows2000
Thank you for advance
CharaHi,
Here is a small resumen About Basic Auditing in Oracle.
For any Oracle versions prior to 9i you will need to set audit_trail parameter in the pfile ie.g.:
audit_trail = DBFor later Oracle Versions:
SQL>alter system set audit_trail = DB;To enable auditing for a specific object run the following command:
SQL>AUDIT SELECT, INSERT, UPDATE, DELETE ON SCHEMA.TABLE;To stop auditing use:
SQL>NOAUDIT SELECT, INSERT, UPDATE, DELETE ON SCHEMA.TABLE;Or to audit any statement that queries, delete, insert or updates any table, issue the following statement:
SQL>AUDIT SELECT TABLE, DELETE TABLE, INSERT TABLE, UPDATE TABLE;If you want to audit a specific user will need to run the following commands:
SQL>AUDIT ALTER TABLE, SELECT TABLE, INSERT TABLE, … ,GRANT PROCEDURE by <USERNAME>;To stop the audit for the user you will need to run:
SQL>NOAUDIT ALTER TABLE, SELECT TABLE, INSERT TABLE, … ,GRANT PROCEDURE by <USERNAME>;To see the results of the auditing use please run:
SQL> select * from dba_audit_trail;This is an excellent Oracle documentation to learn how to implement it:
- http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm
Also I’ll recommend you to take a look on the following links:
- http://www.oracle-base.com/articles/8i/Auditing.php
Cheers,
Francisco Munoz Alvarez
http://www.oraclenz.com -
I have a simple requirement of developing web services to retrieve data from multiple tables of Oracle data base. I just wonder do we need to use DB adapter or SQL statements in the code. How the performance will vary with these two. The volume of data may be high. Any pointers will be appreciated.
Suggest you to post on SOA Forum - SOA Suite
-
OSM DataInstance JDBC Adapter: Invalid SQL issue....
Hi,
We are facing one issue while using the database adapter as DataInstance Behavior.
Here are the scripts we used for the highlighted parameters:
oms:datasource as XPATH: 'mslv/oms/oms1/internal/jdbc/DataSource'
oms:sql as XQUERY:
<instance name="OSM" xsi:type="externalInstanceType">
<adapter>com.mslv.oms.view.rule.adapter.DatabaseAdapter</adapter>
<parameter name="oms:dataSource"> 'mslv/oms/oms1/internal/jdbc/DataSource'</parameter>
<parameter name="oms:sql">
"SELECT P.NODE_VALUE_TEXT FROM ORDERMGMT_OSMINSTALL.OM_ORDER_INSTANCE P
JOIN ORDERMGMT_OSMINSTALL.OM_ORDER_DATA_DICTIONARY PP
ON P.DATA_DICTIONARY_ID=PP.DATA_DICTIONARY_ID
where PP.DATA_DICTIONARY_MNEMONIC='site_id' "
</parameter>
</instance>
The following error logged in Logfile:
<Feb 18, 2014 5:30:16 AM IST> <Error> <oms> <BEA-000000> <impl.j: failed to invoke adapter for externalInstanceType: name[DataInstance] class[com.mslv.oms.view.rule.adapter.DatabaseAdapter]
com.mslv.oms.view.rule.adapter.AdapterException: java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
at com.mslv.oms.view.rule.adapter.DatabaseAdapter.retrieveInstance(Unknown Source)
at oracle.communications.ordermanagement.rule.impl.j.getExternalInstance(Unknown Source)
at oracle.communications.ordermanagement.rule.impl.j.findInstance(Unknown Source)
at oracle.communications.ordermanagement.rule.impl.a.a(Unknown Source)
at oracle.communications.ordermanagement.rule.impl.a.a(Unknown Source)
Truncated. see log file for complete stacktrace
Caused By: java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
Truncated. see log file for complete stacktrace
Can you pls suggest the remedy for this issue in the SQL? The same SQL runs well in TOAD and also shows the selected rows.
Thanks in advance..Thanks Viktor.
I have not tried the Webservice option due to the processing time to retrieve all the orders and then this particular field.
But I have tried both lookup as well as calculate behaviors.
Now I am neither getting any exception in the log nor the update reflects in my Webclient task view. Have your view gets updated with the calculate behavior?
I am using OSM SDK version [7.0.3.745].
My task_view.xml shows as following with lookup:
<viewNode element="b_end_site_id">
<editable>true</editable> <minOccurs>1</minOccurs>
<maxOccurs>1</maxOccurs>
<viewRule xsi:type="dataInstanceRuleType">
<description>DataInstance</description>
<instance xsi:type="externalInstanceType"
name="DataInstance">
<adapter>com.mslv.oms.view.rule.adapter.DatabaseAdapter</adapter>
<parameter name="oms:dataSource">'mslv/oms/oms1/internal/jdbc/DataSource'</parameter>
<parameter name="oms:sql">'SELECT P.NODE_VALUE_TEXT FROM ORDERMGMT_OSMINSTALL.OM_ORDER_INSTANCE P
JOIN ORDERMGMT_OSMINSTALL.OM_ORDER_DATA_DICTIONARY PP
ON P.DATA_DICTIONARY_ID=PP.DATA_DICTIONARY_ID
where PP.DATA_DICTIONARY_MNEMONIC=?'
</parameter>
<parameter name="in:1">'site_id'</parameter>
<cache>
<scope>SYSTEM</scope>
<timeout>15000</timeout>
<maxSize>50</maxSize>
</cache>
</instance>
</viewRule>
<viewRule xsi:type="lookupRuleType">
<annotation>
<documentation>This behavior retrieves the inline XML defined for the data instance behavior and displays it as a lookup field, which is the same as a dropdown list field, in the Web client</documentation>
</annotation>
<description>LookUp</description>
<itemset>
<nodeset>instance('DataInstance')/rowSet/row/NODE_VALUE_TEXT</nodeset>
<value name="Value" openSelectionSeverity="CRITICAL" sortOrder="0" sortDirection="ascending" hidden="false" position="0">
<node>text()</node>
</value>
</itemset>
</viewRule>
</viewNode>
With Calculate, it shows following:
<viewNode element="a_end_site_id">
<editable>true</editable> <minOccurs>1</minOccurs>
<maxOccurs>1</maxOccurs>
<viewRule xsi:type="dataInstanceRuleType">
<description>DataInstance</description>
<instance xsi:type="externalInstanceType"
name="DataInstance">
<adapter>com.mslv.oms.view.rule.adapter.DatabaseAdapter</adapter>
<parameter name="oms:dataSource">'mslv/oms/oms1/internal/jdbc/DataSource'</parameter>
<parameter name="oms:sql">'SELECT P.NODE_VALUE_TEXT FROM ORDERMGMT_OSMINSTALL.OM_ORDER_INSTANCE P
JOIN ORDERMGMT_OSMINSTALL.OM_ORDER_DATA_DICTIONARY PP
ON P.DATA_DICTIONARY_ID=PP.DATA_DICTIONARY_ID
where PP.DATA_DICTIONARY_MNEMONIC=?' </parameter>
<parameter name="in:1">'site_id'</parameter>
<cache>
<scope>SYSTEM</scope>
<timeout>15000</timeout>
<maxSize>50</maxSize>
</cache>
</instance>
</viewRule>
<viewRule xsi:type="calculateRuleType">
<description>Calculation</description>
<calculation>instance('DataInstance')/rowSet/row/NODE_VALUE_TEXT/text()</calculation>
</viewRule>
</viewNode> -
JDBC adapter access to iSeries DB files in libraries
Hello,
We try to connect to an AS400 iSeries system via JDBC adapter!!! (not a typical scenario I think!)
The files (so called by IBM but we identify them as tables in our understanding ) are stored in libraries.
The question is how to add this library (like a path?) into JDBC adapter and interface description.
Adapter:
JDBC Driver: <driver name>
Conenction: <physical address of iSeries DB>
LogIn data: xxx
Interface description:
MESSAGE
STATEMENT = []
TABLENAME
ACTION = select
TABLE = DBNAME.TABLENAME
The interface description is from another successful implementation on an ORACLE DB.
I think the table definition should contaion the library like
<DBNAME>.<LIBRARY>.<TABLENAME>
separated by dots!
I am not sure. So can anyone correct or agree?
Currently we are not ready for a first try because the driver installation is next week.
But it would help to know what we have to do instead of spending possibly a lot of time for trial and error.
Kind Regards
Dirk
Of course, helpful answers are valued by points!I don't know this mechanism of high availability with 2 IP, but if you really have 2 hostname you should think to a method to switch from a node to the other in easy way, deactivating one and activating the other (for instance with the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/45/0c86aab4d14dece10000000a11466f/frameset.htm">Controlling a Communication Channel Externally</a>)
I suggest you to verify how it will be in production instance: real cluster ? switch over ? virtual IP ?
Regards,
Sandro -
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 Receiver: exact SQL statement
Hi,
I'm in an IDoc-JDBC scenario, using XML-SQL messages to feed a JDBC Receiver and I am getting <i>weird messages</i> returned by Oracle.
Question: is there a way to log/trace/audit <b>the exact SQL statement</b> that my channel is sending to Oracle??
Thanks.
Alexhi Alessandro,
try: logSQLStatement
from SAP note: 801367
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a> -
JDBC Adapter - DELETE like statement
Hi all,
I want to DELETE some data from SQL SERVER.
My SQL statement is:
DELETE FROM dbTableName WHERE col1 = u2019val1u2019 AND
col2 LIKE u2019*u2019 AND
col3 = 'val3'
My XML message is:
<statement1>
<LINES action="DELETE">
<table>dbTableName</table>
<key>
<col1>val1</col1>
<col2 compareOperation="LIKE ">*</col12>
<col3>val3</col3>
</key>
</LINES>
</statement1>
I don't receive any error, but nothing is deleted from dbTableName.
Waiting for some suggestions.
Regards,
Natalia.Hi,
I have a trigger in SQL SERVER on this table:
add update/delete trigger to dbTableName table */
CREATE TRIGGER tr_DBTABLENAME UPDATEDELETE ON DBTABLENAME
instead of update, delete
AS
UPDATE DBTABLENAME
SET
DBTABLENAME .DMLoperation=1,
DBTABLENAME .DMLTimeStamp = GETDATE()
FROM DBTABLENAME JOIN Deleted ON DBTABLENAME .Val1= Deleted.Val1AND DBTABLENAME .VAL2 = Deleted.VAL2 AND DBTABLENAME .VAL3 = Deleted.VAL3
INSERT INTO DBTABLENAME
SELECT Inserted.*
FROM Inserted LEFT JOIN DBTABLENAME ON
DBTABLENAME .Val1= Inserted.Val1AND DBTABLENAME .VAL2 = Inserted.VAL2 AND DBTABLENAME .VAL3 = Inserted.VAL3
WHERE DBTABLENAME .DMLoperation is null
UPDATE DBTABLENAME
SET
DBTABLENAME .Val1= Inserted.Split_Src, DBTABLENAME .VAL2 = Inserted.VAL2, DBTABLENAME .VAL3 = Inserted.VAL3, DBTABLENAME .LAST_FILED = Inserted.LAST_FILED, DBTABLENAME .DMLTimeStamp = GETDATE(), DBTABLENAME .DMLoperation = 2
FROM DBTABLENAME INNER JOIN Inserted ON DBTABLENAME .Val1= Inserted.Val1AND DBTABLENAME .VAL2 = Inserted.VAL2 AND DBTABLENAME .VAL3 = Inserted.VAL3
May be this is the reason.
Thanks,
Natalia. -
JDBC Adapter for SQL Server 2003
We are trying to connect from XI to SQL Server 2003 for the first time. Does anyone know what values to use for these 2 parms in the JDBC receiver channel:
1) JDBC Driver
2) ConnectionHi,
JDBC Driver :
jdbc:microsoft:sqlserver://<server name>;DatabaseName=Nameof database
Connection:
com.microsoft.jdbc.sqlserver.SQLServerDriver
If Driver is not installed for SQL than use this doc:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f04ce027-934d-2a10-5a8f-fa0b1ed4d88f
Thanks -
Site System Status Error Message on SiteStat.log : SQL statement with Incorrect Syntax
Hi Folks,
We are getting the below system status error in the primary servers site status log (SiteStat.log) every minute. It relates to the updating of a secondary site.
I have worked out where the SQL syntax is wrong (TimeReported=,) and that it more than likely relates to the day light saving settings last weekend on the secondary sites virtual's host which caused the secondary site server time to go way
into the future, this has now been fixed.
Is there anyway of removing/deleting this system status/SQL query? I have restarted Primary, Secondary and SQL server, to no avail.
Any help would be greatly appreciated.
*** [42000][102][Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ','. SMS_SITE_SYSTEM_STATUS_SUMMARIZER 01/11/2012 14:45:58 5756 (0x167C)
---->: Could not execute the SQL command:
UPDATE Summarizer_SiteSystem SET Status=0,SiteCode='001',SiteSystem='["Display=\\SERVER\"]MSWNET:["SMS_SITE=001"]\\SERVER\',SiteObject='["Display=\\SERVER\D$\SCCM\"]MSWNET:["SMS_SITE=001"]\\SERVER\D$\SCCM\',ObjectType=0,Role='SMS Component 847496,DownSince=NULL,Replicate=1,PercentFree=76,WarnLevel=102400,ErrorLevel=51200,TimeReported=,AvailabilityState=4
WHERE SiteCode='001' AND SiteSystem='["Display=\\SERVER\"]MSWNET:["SMS_SITE=001"]\\SERVER\' AND SiteObject='["Display=\\SERVER\D$\SCCM\"]MSWNET:["SMS_SITE=001"]\\SERVER\D$\SCCM\' AND Role='SMS Component Server' AND ObjectType=0. Will try again in 60 seconds. SMS_SITE_SYSTEM_STATUS_SUMMARIZER 01/11/2012
14:45:58 5756 (0x167C)
---->: Clearing lost SQL connection and reinitializing it SMS_SITE_SYSTEM_STATUS_SUMMARIZER 01/11/2012 14:46:58 5756 (0x167C)
Thanks
JTeQYes, I know this is an old post, but I’m trying to clean them up.
There is not supported way to fix this. As such I recommend that you contract CSS directly, they will work with you to solve this problem.
Garth Jones | My blogs: Enhansoft and
Old Blog site | Twitter:
@GarthMJ
Maybe you are looking for
-
Source not found exception in JSF processing
Hope this is not a newbie question, but I am stuck here. I am using jdk 1.5_07 with tomcat 5.5 and using Exadel studio for eclipse as my ide. I have created a jsf page with a simple drop down menu. The menu gets its data from a backing bean, which in
-
Need to close icloud account and the ipod was stolen
ipod stolen, need to close mail, how do you do it from a regular library account.
-
HOW CAN I DIRECTLY WRITE ON NEXT PAGE OF SAPSCRIPT
HI, HOW CAN I DIRECTLY WRITE ON NEXT PAGE OF SAPSCRIPT. I want to call certain fields on next page only is it possible? How? Regards mave
-
hai guys, I would like to purchase license for remote panel server (5 user).As for now without the license only 1 user can use it at a time.Would like to know if i purchase the license it will be 5 user or 5+1(existing free user). thanks regards kok
-
Hi there, I'm learning using JPA by writing a web application example that check username and password. I use Sun Application Server 9.1 and Myeclipse to build and deloy. I've got Runtime Exception: Unknown entity bean class: class vn.kbnn.dtkb.syste