EXECUTED STATEMENTS

I had executed a SQL statement on 10g over the weekend which I lost it in power surge. Is there anyway to view executed statements by USER?
thanks

All succeeded sql-clauses can be seen with this query:
SELECT *
FROM V$sqlarea a
WHERE a.Last_Active_Time > SYSDATE - 5
--and upper(a.SQL_TEXT) like '%SOMETHING FROM MY WEEKEND SQL%'
ORDER BY a.Last_Active_TimeJust add "SQL_TEXT like"-filter to query and you fastly will find your queries.

Similar Messages

  • Customizing the code inspector with check for two executable statements in same line

    Hi Everyone,
    I have a reuirement to customize the code inspector.I need to create a check 'Two executable statements should not be in the same line'.
    While doing so i am facing one problem as in internal table it is capturing the report as word by word with same row number nd different line number.
    If anyone have worked on this before then help me out.
    I am using CL_CI_TEST_SCAN as superclass and making the changes in the run method.
    Regards,
    Khushboo

    In the source code you will have this in comment right, use the "#EC ENHOK.

  • Error when executing statement for table/stored proc

    Hi All,
          I am getting this error when executing IDOC to JDBC (Stored Procedure) Scenario.
         In my stored procedure I have three insert statements to insert rows in to 3 tables.
        This stored procedure is working fine for two insert statements i.e, 
             For this I have created data type for stored procedure with 10 elements and executed the scenario and was successfully running.
        when I added 3rd insert statement to stored procedure ie., when i added 5 more elements to the datatype (totally 15 elements) it starts giving the bellow error in Message Monitoring.
    <i><b>Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
    <i><b>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
       Note:- I have run the stored procedure  with three insert statements in Sql Server, and also by calling an external program also, and was working fine.
    <i><b> Note : Is there any structure needs to be follow when working with IDOC to Stored procedure.</b></i>
    I am struck up with the error, can any body resolve this issue.
    Thanks in Advance,
    Murthy

    Hi narasimha,
                      This seems to be any error due to incorrect query formation.In your receiver jdbc channel set the parameter logSQLstatement = true.you can find this parameter in the advanced mode. Using this parameter you will be able to see the sql query which is generated at runtime in the audit log in RWB.
    Regards,
    Pragati

  • Avoid JDBC sender error: Execute statement did not return a result set

    Hi!
    My JDBC sender adapter towards MS SQL server works fine, with an Execute statement calling a stored procedure that returns the source data needed. The stored procedure itself updates the status of database table records, so that only the unread records are returned each time the stored procedure is called.
    However, the communication channel monitoring sets a red flag for the JDBC sender adapter, when there are no values to fetch from the database table (using the stored procedure). Message says: "Database-level error reported by JDBC driver while executing statement 'EXECUTE FetchMessage 1, 9000'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor."
    This is not an error situation, as I do not expect there to be any values to fetch from the database at all times.
    I do not see how to change the stored procedure to avoid this error.
    Is there a parameter to be set on the JDBC adapter that I can use, so the red flag is avoided?
    Thanks for any input!
    Regards,
    Oeystein Emhjellen

    Hi Oeystein Emhjellen.
    The problem is Store Procedure that has to generate always a ResultSet (or cursor). If it doesn't have a output, you have to generate an Empty ResultSet.
    Like a SELECT Statement:
    If there are data, SELECT get an output result but if it get nothing the SELECT Statement get a empty ResultSet.
    Ask to your database team.
    I hope it helps you.
    Bruno.

  • Error processing request in sax parser: Error when executing statement...

    Hello,
    I want to INSERT data from R/3 System to AS400 via JDBC adapter into a DB2 database. The interfaces from R/3 are Ok. but i have some problems to use the JDBC in DB2 Systems. The message in comunitation channel is:
    " Error processing request in sax parser: Error when executing statement for table/stored proc. 'SPE106TST' (structure 'STATEMENT'): java.sql.SQLException: SPE106TST de SADMT1 no válido para la operación."
    in the SXMB_MONI -> Request Message Mapping payloads this:
    The connection to the database is fine, Sender adapter with a SELECT * works perfect.
    Please Can anyone help me solve this problem? I'm lost.
    Best regards,
    Edited by: Nicola Occhipinti on May 22, 2008 7:40 PM

    Hi Nicola,
    This error occurs when the receiver side structure is incorrect.
    Your structure seems to be correct.
    Please use lower case for action, access and table.
    Please check whether the field names are exactly the same as in the actual Database table sadmt1.SPE106TST.
    Check if the table has permissions to write.
    You can try an alternate structure without using table tag.
    <ns0:MT_XMLSQL_SPEC xmlns:ns0="urn:damm.com/pi/EmployeeMasterData">
    <STATEMENT>
    <sadmt1.SPE106TST action="INSERT">
    <access>
    <CODEMP>D</CODEMP>
    <CODPRO>00202339</CODPRO>
    <NOMPRO>ROSIQUE PERALSGENIS</NOMPRO>
    <DIRPRO>GIRONA</DIRPRO>
    <POBPRO>S. VICENS HORTS</POBPRO>
    <RUTA>0</RUTA>
    <ORDEN>0</ORDEN>
    <NOMINA>S</NOMINA>
    </access>
    </sadmt1.SPE106TST>
    </STATEMENT>
    </ns0:MT_XMLSQL_SPEC>
    Hope your problem gets solved.
    -Shamly

  • File to JDBC :Error when executing statement for table/stored proc.

    Hi,
    I am getting following error when i am trying to insert data into z-table using JDBC recr adapter.
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ZTEST' (structure 'STATEMENT'): java.sql.SQLException: <u>[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name '<b>ZTEST</b>'.</u>
    But the database table name 'ZTEST' exists in the system.
    XML structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_RECR xmlns:ns0="http://urn:srini/FileToJDBC">
       <STATEMENT>
          <TEST action="INSERT">
             <table>ZTEST</table>
             <access>
                <ROLLNO>123</ROLLNO>
                <FIRSTNAME>ABC</FIRSTNAME>
                <LASTNAME>XYZ</LASTNAME>
             </access>
          </TEST>
       </STATEMENT>
    </ns0:MT_RECR>
    Regards,
    Srinivas

    Hi,
    I have changed my MT str but still getting the same error.Is it possible to insert/ update a z-table using JDBC adapter.
    XML str:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_RECR xmlns:ns0="http://urn:srini/FileToJDBC">
       <STATEMENT>
          <ZTEST action="INSERT">
             <access>
                <ROLLNO>123</ROLLNO>
                <FIRSTNAME>abc</FIRSTNAME>
                <LASTNAME>XYZ</LASTNAME>
             </access>
          </ZTEST>
       </STATEMENT>
    </ns0:MT_RECR>
    Regards,
    Srinivas

  • Statement not in an executed state. ?

    Hi All,
    I am getting the following error:
    Exception: verifyPassword=java.sql.SQLException: [Microsoft][SQLServer 2000 Driv
    er for JDBC]Invalid operation.  Statement not in an executed state.What could be the problem ?
    Thanks
    Harish Pathak

    Sorry I forgot to place the code..
    here is the code..
    public boolean verifyPassword(String username, String password) {
            String originalPassword=null;
            try {
                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
               Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://sqlserver:1433","harish","harish");
               PreparedStatement pstmt = con.prepareStatement("select password from registration where username='"+username+"'");          
               ResultSet rs = pstmt.getResultSet();
               if(rs.next()) {
                   originalPassword=rs.getString(1);
               pstmt.close();
               if(originalPassword.equals(password)) {
                   return true;
               } else {
                   return false;
           } catch (Exception e){
               System.out.println("Exception: verifyPassword="+e);
               return false;
        }Please reply soon.

  • Sql - execute statement problems

    I have a "try" with a "catch" that contains an sql execute statement, and some statements after that, but it doesn't execute any of the following statements. It successfully compiles and has no errors when I run it. It just doesn't insert the information and it stops every command that follows. When I remove the execute state (the one with the asterist next to it), the following statements execute fine. Any information on what I might be missing would be greatly appreciated. Thanks.
    try{
    new JdbcOdbcDriver();
    String url = "jdbc:odbc:javadb";
    String user = "";
    String password = "";
    Connection con =
    DriverManager.getConnection(url, user, password);
    Statement stmt = con.createStatement();
    System.out.println("Made the Connection");
    *stmt.executeUpdate("INSERT INTO tbl VALUES ('bradley')");
    System.out.println("Made the Connection");
    JOptionPane.showMessageDialog(this, "Data Inserted");
    }catch(Exception e)
    e.printStackTrace();
    }

    Look in your log file. When you perform "e.printStackTrace()" the stack is sent to the System.out, which JSP has already redirected to the log.
    If you're having trouble finding the log (it depends on what webserver you're using), try changing that to:
    out.println("<h3>We have an error: " + e + "</h3>");
    (Notice the absense of "System." here. We're using the pre-defined JSP "out" object that's going to the client browser.)
    That will print the error message, plus the reason for the error, on your client as 2nd level header.
    Personally, I always print out my error messages in this manner. I find that having a full, complete, extensive stack trace is next to useless. It's like asking for the definition of the word "Java", and having the Oxford Unabridged Dictionary dropped in your lap.

  • Oracle Error - statement handle not executed state

    Hello,
    A BCA scheduled job has failed and returned with the following error. Does anyone have an idea to fix this error.
    Connection or SQL sentence error: (DA0005): [Exception: DBD, ORA-24338: statement handle not executed State: N/A] The following data providers have not been successfully refreshed
    Thanks
    -Gopi

    Please provide more information on what Crystal Reports or Business Objects product you are using. The more details you can provide, the quicker the resolution...
    Ludek

  • Error when executing statement for table/stored proc  DB2 - Data Truncation

    Hi,
      I have one call sp in XI with n parameters int and two parameters out.
       well, to implement the interface gives the following error
    com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SPSAPAR9' (structure 'Statement'): java.sql.SQLException: The number of parameter values set or registered does not match the number of parameters
    Thanks for your help
    Ximena
    Edited by: Ximena Gonzalez on Feb 19, 2008 11:50 AM
    Edited by: Ximena Gonzalez on Feb 20, 2008 12:17 PM

    My Error is change
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAPPRG.SPSAPAR9' (structure 'Statement'): java.sql.DataTruncation: Data truncation
    but de change DT SP
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns1:AlistReqDet2_MT xmlns:ns1="urn:proxl:tmuc:proxl01:AlistReqItems">
    <Statement>
    <SPSAPAR9 action="EXECUTE">
      <table>SAPPRG.SPSAPAR9</table>
      <ISAPNU1 isInput="TRUE" type="STRING">0080000353</ISAPNU1>
      <ISAPEM1 isInput="TRUE" type="STRING">'LU'</ISAPEM1>
      <ISAPC05 isInput="TRUE" type="STRING">15353</ISAPC05>
      <ISAPSEC isInput="TRUE" type="STRING">10</ISAPSEC>
      <ISAPLOT isInput="TRUE" type="STRING">'lats'</ISAPLOT>
      <ISAPCA1 isInput="TRUE" type="STRING">10</ISAPCA1>
      <ISAPCA2 isInput="TRUE" type="STRING">10</ISAPCA2>
      <ISAPKIL isInput="TRUE" type="STRING">10</ISAPKIL>
      <ISAPES1 isInput="TRUE" type="STRING">'T'</ISAPES1>
      <ISAPSW isOutput="TRUE" type="STRING" />
      </SPSAPAR9>
      </Statement>
      </ns1:AlistReqDet2_MT>

  • Sequence.nextval doubles the returned value with Execute Statement (F9)

    There appears to be a quirk with sequences in Raptor.
    Has anyone noticed that depending on how you execute this sql (SELECT MYSEQ.NEXTVAL FROM DUAL;) the value returned is either the correct nextval or double what you expected?
    For example, MYSEQ is a simple sequence which increments by 1. If you Execute Statement (F9) then the value returned jumps by 2 instead of 1. If you Run Script (F5) then the value returns jumps by 1, as expected.
    If MYSEQ is changed to increment by 2. The when you Execute Statement (F9) then the value returned jumps by 4 instead of 2. If you Run Script (F5) then the value returns jumps by 2, as expected. No matter what you put for the increment by Execute Statement (F9) always doubles it.
    It always seems to be double. Executing the same scenario in TOAD always returns the correct value (i.e. properly increments).
    Is the query being executed multiple times with Execute Statement? Why is this happening?

    While there is no guarantee from Oracle that sequences produce sequential numbers, this is obviously a case where SQL Developer is running the select statement twice.
    The issue is that queries can actually change information, rather than just retrieve data from the database.
    The following package is a test case:
    create or replace package test_query is
    function get_next_count return number;
    end;
    create or replace package body test_query is
    cnt number := 0;
    function get_next_count return number is
    begin
    cnt := cnt + 1;
    return cnt;
    end;
    end;
    select test_query.get_next_count from dual;
    This query, which should return 1, 2, 3, 4, etc actually returns 2, 4, 6, 8, etc, because SQL Developer is running the select twice.

  • EA3 : "Execute statement" in SqlWorksheet extremely slow

    I have a .sql file with numerous individual sql statements separated by semicolon (it is not a script file - just a log of sql stmts) .
    example: :
    select *
    from tableA
    where ...
    select *
    from tableB
    where ....
    The sql file that I have has 13274 lines size 467 Kb. I notice that if I keep the cursor on any sql statement, and then try to execute statement, it takes way too long. Shows the same slowness when I copy the entire worksheet to a new one and try execute statement in Sql Developer.
    However reducing the number of lines in the sql file helps the same statement run considerable faster. However I do not want to do that...
    eg select *
    from tableA
    ===> tableA has just 2 rows.
    If number of lines = 13274 this sql takes 0.02992196 secs
    If number of lines = 5832 this sql takes 0.00596668 secs
    If number of lines = 3371 this sql takes 0.00479474 secs
    I tried copying the entire worksheet to Toad, but the sql was quick as ever.
    Any ideas how this can fixed in Sql Dev ?
    Thanks,
    Anne

    Wow! Selecting the statement and executing is way faster. So can the issue be fixed for executing statement with cursor positioned on sql statement ?
    Thanks,
    Anne

  • Error when executing statement for table/stored proc.  : ORA-00911

    Hi All,
    I am posting IDOC->XI->JDBC, approx 5000 Idocs.
    But few messages are giving following error in XI-_SXMB_MONI
    Can any one guide me what is the cause of error? I check whole Idoc data I am not able to see bad character? can any once guide me what are the bad character in XML to post data in oracle? so that i can search in XML and how to avoide this error.
    "com.sap.aii.af.ra.ms.api.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'HRP1001' (structure 'INSERT_PAD34'): java.sql.SQLException: ORA-00911: invalid character"

    > I am talking about following IDOC.<ZRMD_A06> ->
    > <E1PLOGI SEGMENT="1">-> <E1PITYP SEGMENT="1"> ->
    > <E1PAD34 SEGMENT="1"> -><PROZT>0.00 #</PROZT>.
    > Can we remove this # during message mapping in XI??
    sure you can remove it using Replace function or by writing UDF.
    as I am seing # is last character..<b>so remove # with " " (single space) and then use the TRIM fucntion.</b>
    Thanks
    Farooq.
    *<b>Rewards points if you find it useful*</b>

  • Oracle 9 - find most cpu consuming SQL + latest executed statement by user

    Hi,
    1. Can someone tell me how to find most CPU consuming SQL statement?
    (Is this CPU_TIME in v$sql and v$sqlarea? if so is it in miliseconds?)
    2. How can I find latest executed statement by a user and latest executed statement on the database (no mater what user)?
    Thank you in advance.
    Gr,
    Ad

    hi,
    SELECT CPU,Total_Rows,sql_text FROM(
    SELECT (s.cpu_time/1000000) CPU, sa.rows_processed Total_Rows, SUBSTR(sa.sql_text,1,50) sql_text
    FROM v$sqlarea sa, v$sql s
    WHERE sa.parsing_user_id =
    (SELECT user_id FROM dba_users WHERE username='USER'
    AND s.sql_text = sa.sql_text)
    ORDER BY s.cpu_time DESC)
    WHERE ROWNUM <= 10
    Or else you can generate awr/statspack report and check the sqls which are order by more cpu_time.
    2. How can I find latest executed statement by a user select a.username,a.logon_time,b.SQL_FULLTEXT from v$session a,v$sqlarea b where
    a.sql_id=b.sql_id
    and a.username='USER'
    order by a.logon_time desc
    latest executed statement on the database select a.username,a.logon_time,b.SQL_FULLTEXT from v$session a,v$sqlarea b where
    a.sql_id=b.sql_id
    order by a.logon_time desc
    HTH
    regards
    Jafar

  • Procedure executes statement and exists prematurely

    I have been getting so much incredible help, I figure why stop now!
    I have the following procedure. It runs perfectly until it gets to the line marked "--THIS LINE GETS EXECUTED AND THEN THE ROUTINE EXITS". I suspect this has something to do with all the begin..end statements but without them I get invalid sql statements errors. Any advice on how I can make this work?
    PROCEDURE INTERPRET_LOOP
        p_MasterTable   IN  VARCHAR2,
        p_PrimaryIDField IN VARCHAR2)
    AS
        cursor TableName_Tab IS
            select distinct DBTABLENAME from DATASPECIFICATIONS;
        v_TableName VARCHAR2(25);
        CURSOR FieldNames_Tab (cv_TableName VARCHAR2) IS
            select distinct SHORTNAME, QCTYPE, LOWVALUE, HIGHVALUE from DATASPECIFICATIONS where DBTableName = cv_TableName;
        v_FieldName VARCHAR2(25);
        v_QCType VARCHAR2(100);
        v_High VARCHAR2(25);
        v_Low VARCHAR2(25);
        v_SQL VARCHAR2(2000);
    BEGIN
        OPEN TableName_Tab;
        Loop
            Fetch TableName_Tab into v_TableName;
            Exit when TableName_Tab%NOTFOUND;
            --interpret each field based on data type
            --select list of fields and types to loop through
            OPEN FieldNames_Tab(v_TableName);
            Loop
                Fetch FieldNames_Tab into v_FieldName, v_QCType, v_High, v_Low;
                Exit when FieldNames_Tab%NOTFOUND;
                If (instr(UPPER(v_QCType), 'RANGE') > 0) Then
                    v_SQL:= 'HT_QCINTERPRET.INTERPRET_'||UPPER(v_QCType)||'('''||UPPER(v_FieldName)||''', '''||v_Low||''||', '''||v_High||''||', '''||UPPER(v_TableName)||''');';
                ElsIf (instr(UPPER(v_QCType), 'DATA') > 0) Then
                    v_SQL:= 'HT_QCINTERPRET.INTERPRET_'||UPPER(v_QCType)||'('''||UPPER(v_TableName)||''');';
                Else
                    v_SQL:= 'HT_QCINTERPRET.INTERPRET_'||UPPER(v_QCType)||'('''||UPPER(v_FieldName)||''', '''||UPPER(v_TableName)||''');';
                End If;
                v_SQL := 'BEGIN '||v_SQL||' END;';
                execute immediate v_SQL;    --THIS LINE GETS EXECUTED AND THEN THE ROUTINE EXITS
            End Loop;
            --update DATAINFO table.  insert interpretation failures
            If v_TableName <> p_MasterTable Then
                v_SQL := 'insert into DATAINFO select p.'||UPPER(p_PrimaryIDField)||', 1, t.RECORDID, '''||UPPER(v_FieldName)||''', '||CURRENT_DATE||', p.DATAVRSN, '''||UPPER(v_QCType)||'''';
                v_SQL := v_SQL||' from '||UPPER(v_TableName)||' t left join '||UPPER(p_MasterTable)||' p on t.'||UPPER(p_PrimaryIDField)||' = p.'||UPPER(p_PrimaryIDField);
                v_SQL := v_SQL||' where t.'||UPPER(v_FieldName)||' is NULL and t.'||UPPER(v_FieldName)||'_IN is NOT NULL';
            Else
                v_SQL := 'insert into DATAINFO select p.'||UPPER(p_PrimaryIDField)||', 1, p.RECORDID, '''||UPPER(v_FieldName)||''', '||CURRENT_DATE||', p.DATAVRSN, '''||UPPER(v_QCType)||'''';
                v_SQL := v_SQL||' from '||UPPER(v_TableName)||' p ';
                v_SQL := v_SQL||' where p.'||UPPER(v_FieldName)||' is NULL and p.'||UPPER(v_FieldName)||'_IN is NOT NULL';
            End If;
            v_SQL := 'BEGIN '||v_SQL||' END;';
            execute immediate v_SQL;
            close FieldNames_Tab;
        End Loop;
        close TableName_Tab;
        commit work;
    END INTERPRET_LOOP;Thanks!!!!

    Hmmm,
    Interesting. Never typed a >< in here.
    Btw, try doing a dbms_output.put_line(V_SQL) before the execute immediate. i.e
            v_SQL := 'BEGIN '||v_SQL||' END;';
            dbms_output.put_line(v_SQL);
            execute immediate v_SQL;and see if that gets printed properly (and also as expected)
    -Arun
    Edited by: Arunkumar Ramamoorthy on Oct 22, 2009 1:08 AM

Maybe you are looking for