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.
Alex

hi 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>

Similar Messages

  • Which view contains the exact sql statement

    Dear All,
    Developers have used bind variables in their sql inside their applications (for example: SELECT Name FROM Employee WHERE EmployeeID =:empno)
    This bind variable is supplied a value within the application. I wanted to know which data dictionary view will give me the exact sql statement which gets executed.
    For example SELECT Name FROM Employee WHERE EmployeeID = 100;
    When I query V$SQL, V$SQLAREA, V$SQLTEXT, I get the same query with the bind variables (SELECT Name FROM Employee WHERE EmployeeID =:empno), instead can i get the query which actually holds the value for the bind variable.
    Regards,
    qA

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4254158186083#75306330816538

  • 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,
    Rohit

    you 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

  • 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,
    Francesco

    hi,
    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.
    Pansy

    Hi 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

  • 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 - SQL-Statement

    Hi,
    I'm using the JDBC-Sender-Adapter and need to use a SQL-Statement like this:
    SELECT * FROM myTable WHERE myDate = <current_date>
    Is such a dynamic-sql possible, or can I only use static sql-statements. And if yes how can I solve this problem.
    many thx

    Hi Werner,
    inside the <b>Query SQL Statement</b> you can use <b>SQL EXECUTE</b>
    which can execute a stored procedure
    in which you can do
    SELECT * FROM myTable WHERE myDate = <current_date>
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • 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.

  • 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.

  • Current Exact sql statement

    Dear Group
    Can any one suggest how can i see the Exact sql which was fired from the application.
    SELECT SQL_TEXT
    FROM V$SQLAREA
    WHERE (ADDRESS, HASH_VALUE) IN
    (SELECT SQL_ADDRESS, SQL_HASH_VALUE
    FROM V$SESSION
    WHERE SID = &sid_number)
    I mean with out "SYS_B_0" in the sql statement
    Thank you
    Message was edited by:
    Paddy01

    Hi,
    The value you are looking for is called as bind value.
    If you are on 8i, I am not sute how you will find the value. You can certainly it in the trace file.
    In 9i onwards, there is a view, v$sql_bind_data, which shows the bind value. But, still it is tricky.
    Regards
    Rahul

  • JDBC Receiver - java.sql.SQLException

    Hello,
    I am doing a file to JDBC scenario. When I execute, I am getting the following error:
    Unable to execute statement for table or stored procedure. 'dbo.empl' (Structure 'STATEMENT') due to java.sql.SQLException: FATAL ERROR: Column 'address' does not exist in table 'dbo.empl'
    Here, empl is the table name in SQL server. The field 'address' available in the SQL server , but i am getting the above mentioned error.
    My JDBC input structure is as follows:
    <STATEMENT>
    <TEST action="INSERT">
    <table>dbo.empl</table>
    <access>
    <empid></empid>
    <empname></empname>
    <address></address>
    <empage></empage>
    <joindate></joindate>
    <flag></flag>
    </access>
    </TEST>
    </STATEMENT>
    Can anyone help?
    Regards
    Vaane

    >>>>>Unable to execute statement for table or stored procedure. 'dbo.empl' (Structure 'STATEMENT') due to java.sql.SQLException: FATAL ERROR: Column 'address' does not exist in table 'dbo.empl'
    Check your table empl structure??
    Does it have the field address?? XI is case sensitive!!Check you have the correct spelling and case...
    Regards,
    Jai Shankar.

  • JDBC receiver MS SQL Server encryptation

    Hi all,
    I have to configure a communication channel from a PI 7.0 to MS SQL Server 2005 database to execute updates. I have already deployed the com.microsoft.sqlserver.jdbc.SQLServerDriver driver.
    I have been asked whether SSL encryptation can be used. I have found an example for an Oracle database. The following aditional parameters can be specified:
    driver.oracle.net.encryption_clien = ACCEPTED
    driver.oracle.net.encryption_types_client = RC4_40
    driver.oracle.net.crypto_checksum_client = ACCEPTED
    driver.oracle.net.crypto_checksum_types_client = MD5
    Does anybody know if these or similar parameters can be used for the SQL Server Driver?
    Thanks in advanced for your advice

    >Does anybody know if these or similar parameters can be used for the SQL Server Driver?
    Search in microsoft SQL Server web link for this. Sure, you cannot use the same oracle syntax for SQL Server. Plus what SQL Server do you use ?  These server encryption are required to configure at database server too. If the version what do you use does not suppor then there is no point in configuring at the channel side.
    The oracle parameters are supported only Oracle 10 and above versions only. I believe you are referring this link
    http://wiki.sdn.sap.com/wiki/display/XI/EncryptioninscenariosinvolvingJDBCAdapterwithOracleDatabase

  • Jdbc receiver diffrent sql versions

    hello
    we are using 2 types of sql 2000 & 2005
    do you know if the 2005 jdbc driver only is compatible for version 2000 also?
    thx and regards
    shai

    Hi,
    The drivers for sql 2000 & 2005 might be different.
    But if you are using 2000 and want to upgrade it to 2005 then you need use different format of the URL and driver name like,
    If you are using SQL Server 2005 driver, then class name should
    be as follows:                                                                               
    Driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver     
    URL :jdbc:sqlserver://<db_Server>:port;databaseName=<db_name>  
    If you are using SQL Server 2000 driver , then class name should
    be as follows:                                                                               
    Driver class: com.microsoft.jdbc.sqlserver.SQLServerDriver     
    and URL is as follows:                                                                               
    jdbc:microsoft:sqlserver://<db_server>:port;databaseName=<     
    db_name>                                                       
    Check this once and try to run scenario.
    Urs,
    Soorya

  • Sql statement in Summary folders...

    Hi ,
    Is there a way to see the exact sql statement produced when a summary folder has been created....????
    NOTE: I use Oracle Discoverer 10.1.2. version on XP machine.
    Thanks ,
    Simon

    Interesting question.
    I take it that means that if you use a summary folder in Disco, then the SQL Inspector won't show the summary folder redirection in the SQL?

  • How to use Native SQL statement in JDBC receiver interface

    Dear All,
    Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    Select Field1 Field2 from TABLE Where Field3 like "%Name'
    I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    Hence I need to know:-
    1. What message mapping I should use in case if I have to use Native SQL statement.
    2.What operation mapping I should use in case if I have to use Native SQL statement.
    If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    3 .How do to go about it to do the Java mapping.
    Thanks
    Ameet

    >
    Ameet Deshpande wrote:
    > Dear All,
    >
    > Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    >
    > "
    > Select Field1 Field2 from TABLE Where Field3 like "%Name'
    > "
    > I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    >
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    >
    > The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    >
    > Hence I need to know:-
    >
    > 1. What message mapping I should use in case if I have to use Native SQL statement.
    > 2.What operation mapping I should use in case if I have to use Native SQL statement.
    > If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    > 3 .How do to go about it to do the Java mapping.
    >
    > Thanks
    > Ameet
    You can use a stored procedure, and call it from jdbc receiver adapter.
    I also solve this issue, with a DBLookup in message mapping. You can refer to my blog, and this usefull 3d:
    http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

Maybe you are looking for