Retrieve historic sqls

I have been running few queries in the system over the past 10 days and I forgot to save some of those sqls which I ran.
So instead of rewriting all those sqls again - I am hoping to see if sqls run by a user via TOAD is stored anywhere in Oracle.
If so - it might be easy for me to retrieve my sql (hence save lots of time).
The F8 key used in toad to retrieve historic sqls - is not working for me for some reason.
I tried to use the below sql to retrieve all my sql information - but to no avail
select a.logon_time, dbms_lob.substr(b.sql_fulltext, 4000,1)
from gv$session a,gv$sqlarea b
where 1=1
and a.sql_id=b.sql_id
and a.username='H72728'-- my schema name used to login in toad
and a.logon_time between sysdate - 10 and sysdate
order by a.logon_time desc
I am not sure if oracle stores any of this information - but if anyone has an idea of retrieving this information - appreciate if you can share the knowledge.
Thanks

Hi,
connect to sys user then type this script
select sql_text from v$sql
where first_load_time=(select max(first_load_time) from v$sql)Otherwise in your toad press alt+up Arrow or alt+down arrow to see recently executed queries .
Please let us know which oracle version you are using so that we can guide you accordingly .
Thanks,
P Prakash

Similar Messages

  • How to retrieve a SQL query (in String format) from a PreparedStatement

    Hello all,
    I am in the process of unit testing an application accessing a Oracle 9i 9.2 RDBMS server with JDBC.
    My query is:
    As I have access to PreparedStatement and CallableStatement Java objets but not to the source queries which help create those objects?
    Is thtere a simple way by using an API, to retrieve the SQL command (with possible ? as placeholders for parameters).
    I have already looked at the API documentation for those two objets (and for the Statement and ResultSetmetaData objects too) but to no avail.
    Thank you for any help on this issue,
    Best regards,
    Benoît

    Sorry for having wasted your time... and for not understanding what you meant in your first reply.
    But the codlet was only to show the main idea:
    Here is the code which compiles OK for this approach to reach its intended goal:
    main class (file TestSuiteClass.java):
    import java.sql.*;
    import static java.lang.Class.*;
    * Created by IntelliJ IDEA.
    * User: bgilon
    * Date: 15/03/12
    * Time: 10:05
    * To change this template use File | Settings | File Templates.
    public class TestSuiteClass {
    public static void main(final String[] args) throws Exception {
    // Class.forName("oracle.jdbc.OracleDriver");
    final Connection mconn= new mConnection(
    DriverManager.getConnection("jdbc:oracle:thin:scott/tiger@host:port:service"));
    * final Statement lstmt= TestedClass.TestedMethod(mconn, ...);
    * final String SqlSrc= mconn.getSqlSrc(lstmt).toUpperCase(), SqlTypedReq= mconn.getTypReq(lstmt);
    * assertEquals("test 1", "UPDATE IZ_PD SET FIELD1= ? WHERE FIELDPK= ?", SqlSrc);
    Proxy class (file mConnector.java):
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Map;
    import java.util.Properties;
    * Created by IntelliJ IDEA.
    * User: bgilon
    * Date: 15/03/12
    * Time: 10:05
    * To change this template use File | Settings | File Templates.
    * This file should be compiled with JDK 1.6, but can be used with previous JDK versions.
    * See OKwith1pN booleans usage for not throwing Exceptions as Unknown methods by the conn object...
    public final class mConnection implements Connection {
    private final Connection conn;
    private final List<Statement> Stmts= new ArrayList<Statement>();
    private final List<String> SqlSrcs= new ArrayList<String>();
    private final List<Integer> TypSrcs= new ArrayList<Integer>();
    private final static String jvmv= System.getProperty("java.specification.version");
    private static final boolean OKwith1p2;
    private static final boolean OKwith1p4; /* OKwith1p5, */
    private static final boolean OKwith1p6;
    static {
    /* jvmv= System.getProperty("java.version");
    System.out.println("jvmv = " + jvmv);
    jvmv= System.getProperty("java.vm.version");
    System.out.println("jvmv = " + jvmv); */
    System.out.println("jvmv = " + jvmv);
    OKwith1p2= (jvmv.compareTo("1.2") >= 0);
    OKwith1p4= (jvmv.compareTo("1.4") >= 0);
    // OKwith1p5= (jvmv.compareTo("1.5") >= 0);
    OKwith1p6= (jvmv.compareTo("1.6") >= 0);
    public String getSqlSrc(final Statement pstmt) {
    int ix= 0;
    for(Statement stmt : this.Stmts) {
    if(stmt == pstmt) return SqlSrcs.get(ix);
    ix+= 1;
    return null;
    static private final String[] TypeNames= new String[] { "Statement", "PreparedStatement", "CallableStatement" };
    public String getTypReq(final Statement pstmt) {
    int ix= 0;
    for(Statement stmt : this.Stmts) {
    if(stmt == pstmt) return TypeNames[TypSrcs.get(ix)];
    ix+= 1;
    return null;
    private void storedStatement(
    final Statement stmt,
    final String sqlSrc,
    final Integer typReq
    Stmts.add(stmt);
    SqlSrcs.add(sqlSrc);
    TypSrcs.add(typReq);
    public Connection getDecoratedConn() {
    return conn;
    mConnection(final Connection pconn) {
    this.conn= pconn;
    public boolean isClosed() throws SQLException {
    return conn.isClosed();
    public void rollback(Savepoint savepoint) throws SQLException {
    if(OKwith1p4) conn.rollback(savepoint);
    public boolean isReadOnly() throws SQLException {
    return conn.isReadOnly();
    public int getTransactionIsolation() throws SQLException {
    return conn.getTransactionIsolation();
    public void setTransactionIsolation(int level)throws SQLException {
    conn.setTransactionIsolation(level);
    public Properties getClientInfo() throws SQLException {
    return OKwith1p6 ? conn.getClientInfo() : null;
    public <T> T unwrap(Class<T> iface)
    throws SQLException {
    return conn.unwrap(iface);
    public void setAutoCommit(boolean auto) throws SQLException {
    conn.setAutoCommit(auto);
    public boolean getAutoCommit() throws SQLException {
    return conn.getAutoCommit();
    public Map<String,Class<?>> getTypeMap() throws SQLException {
    if(!OKwith1p2) return null;
    return conn.getTypeMap();
    public void setTypeMap(Map<String,Class<?>> map) throws SQLException {
    if(!OKwith1p2) return;
    conn.setTypeMap(map);
    public void setHoldability(final int holdability) throws SQLException {
    if(OKwith1p4) conn.setHoldability(holdability);
    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
    return conn.createStruct(typeName, attributes);
    public void commit() throws SQLException {
    conn.commit();
    public void rollback() throws SQLException {
    conn.rollback();
    public boolean isValid(int timeout) throws SQLException {
    return OKwith1p6 && conn.isValid(timeout);
    public void clearWarnings() throws SQLException {
    conn.clearWarnings();
    public int getHoldability() throws SQLException {
    if(!OKwith1p4) return -1;
    return conn.getHoldability();
    public Statement createStatement() throws SQLException {
    return conn.createStatement();
    public PreparedStatement prepareStatement(final String SqlSrc) throws SQLException {
    if(!OKwith1p2) return null;
    final PreparedStatement lstmt= conn.prepareStatement(SqlSrc);
    storedStatement(lstmt, SqlSrc, 1);
    return lstmt;
    public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
    if(!OKwith1p4) return null;
    final PreparedStatement lstmt= conn.prepareStatement(sql, columnNames);
    storedStatement(lstmt, sql, 1);
    return lstmt;
    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
    final PreparedStatement lstmt= conn.prepareStatement(sql, resultSetType, resultSetConcurrency);
    storedStatement(lstmt, sql, 1);
    return lstmt;
    public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
    final PreparedStatement lstmt= conn.prepareStatement(sql, columnIndexes);
    storedStatement(lstmt, sql, 1);
    return lstmt;
    public void setClientInfo(String name, String value) throws SQLClientInfoException {
    if(OKwith1p6)
    conn.setClientInfo(name, value);
    public PreparedStatement prepareStatement(final String SqlSrc,
    int resultType,
    int resultSetCurrency,
    int resultSetHoldability) throws SQLException {
    final PreparedStatement lstmt= conn.prepareStatement(SqlSrc, resultType, resultSetCurrency);
    storedStatement(lstmt, SqlSrc, 1);
    return lstmt;
    public PreparedStatement prepareStatement(final String SqlSrc,
    int autogeneratedkeys) throws SQLException {
    if(!OKwith1p4) return null;
    final PreparedStatement lstmt= conn.prepareStatement(SqlSrc, autogeneratedkeys);
    storedStatement(lstmt, SqlSrc, 1);
    return lstmt;
    public CallableStatement prepareCall(final String SqlSrc) throws SQLException {
    final CallableStatement lstmt= conn.prepareCall(SqlSrc);
    storedStatement(lstmt, SqlSrc, 2);
    return lstmt;
    public CallableStatement prepareCall(final String SqlSrc,
    int resultType,
    int resultSetCurrency,
    int resultSetHoldability) throws SQLException {
    if(!OKwith1p4) return null;
    final CallableStatement lstmt= conn.prepareCall(SqlSrc, resultType, resultSetCurrency, resultSetHoldability);
    storedStatement(lstmt, SqlSrc, 2);
    return lstmt;
    public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
    return OKwith1p6 ? conn.createArrayOf(typeName, elements) : null;
    public CallableStatement prepareCall(final String SqlSrc,
    int resultType,
    int resultSetCurrency) throws SQLException {
    if (!OKwith1p2) return null;
    final CallableStatement lstmt= conn.prepareCall(SqlSrc, resultType, resultSetCurrency);
    storedStatement(lstmt, SqlSrc, 2);
    return lstmt;
    public SQLXML createSQLXML() throws SQLException {
    return OKwith1p6 ? conn.createSQLXML() : null;
    public DatabaseMetaData getMetaData() throws SQLException {
    return conn.getMetaData();
    public String getCatalog() throws SQLException {
    return conn.getCatalog();
    public void setCatalog(final String str) throws SQLException {
    conn.setCatalog(str);
    public void setReadOnly(final boolean readonly) throws SQLException {
    conn.setReadOnly(readonly);
    public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
    return conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
    public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
    if(!OKwith1p2) return null;
    return conn.createStatement(resultSetType, resultSetConcurrency);
    public String nativeSQL(final String sql) throws SQLException {
    return conn.nativeSQL(sql);
    public void     releaseSavepoint(Savepoint savepoint) throws SQLException {
    if(OKwith1p4) conn.releaseSavepoint(savepoint);
    public Savepoint setSavepoint() throws SQLException {
    return OKwith1p4 ? conn.setSavepoint() : null;
    public Savepoint setSavepoint(final String str) throws SQLException {
    return OKwith1p4 ? conn.setSavepoint(str) : null;
    public boolean isWrapperFor(Class iface) throws SQLException {
    return conn.isWrapperFor(iface);
    public String getClientInfo(final String str) throws SQLException {
    return OKwith1p6 ? conn.getClientInfo(str) : null;
    public void setClientInfo(final Properties pro) throws SQLClientInfoException {
    if (OKwith1p6) conn.setClientInfo(pro);
    public Blob createBlob() throws SQLException {
    return OKwith1p6 ? conn.createBlob() : null;
    public Clob createClob() throws SQLException {
    return OKwith1p6 ? conn.createClob() : null;
    public NClob createNClob() throws SQLException {
    return OKwith1p6 ? conn.createNClob() : null;
    public SQLWarning getWarnings() throws SQLException {
    return conn.getWarnings();
    public void close() throws SQLException {
    conn.close();
    Final word:
    The final word about this is: there is currently three ways to obtain source SQL queries from compiled statement objects.
    a) Use a proxy class the mConnector above;
    b) Use a proxy JDBC driver as Log4JDBC;
    c) Use the trace facility of the driver (however, post analyzing the logs would depend upon the driver selected).
    Thank you for reading,
    Benoît

  • Retrieve underlying SQL query for deski report via java SDK in BOXIR2

    Hi all,
    I am trying to retrieve underlying SQL queries of a deski report in BOXIR2. However I find the error as
    oDataProvider = oDocumentInstance.getDataProviders().getItem(i1);               
    System.out.print(oDataProvider.getName());
    oSQLDataProvider = (SQLDataProvider) oDataProvider;
    oSQLContainer_root = oSQLDataProvider.getSQLContainer();
    But "This feature is not supported for desktop Intelligence " exception has occured.
    I am running the same query for Webi, and I did not find any issue . After several time spending in google, it appears to me that this code is supported by webi only. But "This feature is not supported for desktop Intelligence " exception has occured.
    Please help me to find out the solution in java SDK. If its not supported by Java SDK, then could you please provide me any workaround , e.g. any macro . Any help !!
    Regards,
    Nita
    Edited by: Nita Prasad on Aug 11, 2009 11:20 AM
    Edited by: Nita Prasad on Aug 11, 2009 11:25 AM

    Hi Fritz,
    I am not getting the way.. how to open the deski report programmatically. I am writing the code in this way:
    Dim oInfoObjects1 As CrystalInfoStoreLib.InfoObjects
            Set oInfoObjects1 = oInfoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_NAME='" & oInfoObject.Title & "' AND SI_ID='" & oInfoObject.Id & "' order by SI_NAME")
        Dim oInfoObject1 As CrystalInfoStoreLib.InfoObject
        Dim UserCount1 As Integer
            UserCount1 = oInfoObjects1.ResultCount
            MsgBox "SELECT * FROM CI_INFOOBJECTS WHERE SI_NAME=' " & oInfoObject.Title & " ' AND SI_ID=' " & oInfoObject.Id & " ' order by SI_NAME"
            MsgBox " Total number of Deski reports are : [" & UserCount1 & "]", vbOKOnly
        Dim j As Integer
         For j = 1 To UserCount1
          Set oInfoObject1 = oInfoObjects1.Item(i)
                sFile_ReportList = StrConv(oInfoObject1.Title, vbLowerCase) & ".rep"
                sFile_Output = "D:\TraceWrite1\ " & StrConv(oInfoObject1.Id & "_" & oInfoObject1.Title, vbLowerCase) & ".txt"
                sFile_ReportListTemp = StrConv(oInfoObject1.Files.Item(j), vbLowerCase)
                MsgBox "[" & sFile_ReportList & "]", vbOKOnly
                        If Dir(sFile_ReportList) = "" Then
                MsgBox "The text file [" & sFile_ReportList & "] for the DeskI documents does not exist!" & vbCrLf & "Aborting process."
                Exit Sub
                End If
    I am getting the error on line ...  If Dir(sFile_ReportList) = "" Then...  The code is not able to locate the deski report path.
    Is this the correct way to get a deski report information? Please let me know, If I am going in the right direction.
    Edited by: Nita Prasad on Aug 18, 2009 3:47 PM

  • Content-based image retrieval with SQL/MM Still Image

    Hi
    With ORDIMage signature matching being deprecated in 11g, does anyone have any experience of performing content based image retrieval with SQL/MM Still Image?
    Thanks
    Brian

    The details in that thread is the only information that can be shared.
    Melli
    Oracle Multimedia

  • Retrieve Crystal SQL statements without first submitting parameter values?

    Hi,
    I am retrieving SQL statements for Crystal reports without issue, but a large number of our reports have parameters and for these the following error is thrown when I try to retrieve the SQL statement via RAS using getSQLStatement():
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Missing parameter values.---- Error code:-2147217394 Error code name:missingParameterValueError
    I have a large number of reports I'd like to pull SQL for, so it's not feasible to have my script push parameter values to each and every report.  Is there a way to retrieve SQL statements without first pushing parameter values?
    Thanks

    Hello Jeremy.
    I found a Knowledge Base article that deals with the "Error code:-2147217394 Error code name:missingParameterValueError" error that you mention.  Perhaps you could take a look at the following KBase Article in the Service MarketPlace and see if any of it applies to your situation:
    KBase number: 1420593
    I also found KBase number "1420501 - Report parameters ignored when set by Java post processing code" that seems to deal with the same problem.
    Regards.
    - Robert

  • Field value retrieve from sql query

    Hi,
    Is there any way to code sql query into form field in rtf template ?.
    I have converted an oracle report to BI publisher (e-business suite R12) but I have a form field that contain a sql query that retrieve a value from database. I don't know how to code sql query in form field in rtf template.
    Thanks for help,

    http://winrichman.blogspot.com/search/label/cross%20tab
    http://winrichman.blogspot.com/search/label/Cross-tab
    http://winrichman.blogspot.com/search/label/Dynamic%20column

  • No database object is retrieved in SQL Developer 1.5

    Hi,
    The SQL Developer 1.5 that I have installed can connect to database but when I click on tables, packages or other type, nothing is retrieved.
    I'm very sure I have database objects in above categories as I have been using SQL Developer 1.2.1. What could be not right?
    Please advise
    Thank you.

    I think, the developer forgot the clause for the all_columns view
    where column_id is not null
    Edited by: Lieni on 04.05.2009 13:32
    Edited by: Lieni on 04.05.2009 13:33

  • PDF Form to retrieve historic exchange rates?

    I've been wondering how practical it would be to create a PDF form similar to the webpage www.xe.com/tec/. We would like to create a form with the ability to retrieve the exchange rates for each dated line like the form. Is this possible?

    In principle, it can be done with some scripting, but the amount of data
    you'll have to embed in the file might be astronomical, depending on what
    the scope and accuracy of the historic rates are...

  • Problem retrieving datetime SQL data

    Hi All
    My app is trying to retrieve data from a MSDE sql datetime field in this way:
    DateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
    Date fecha = rsServicios.getDate("fecha");
    System.out.println(sdf.format(fecha).toString());But it returns me all dates with hours, mins and secs with zeros !!
    How could I do to get the real data ?
    Thanks in advance
    J

    But it returns me all dates with hours, mins and secs
    with zeros !!
    How could I do to get the real data ?
    getDate method returns only Date and not the time
    Use getTimeStamp() instead, which returns Timestamp object.
    Timestamp ts=rs.getTimestamp();
    Date d=new Date(ts.getTime());

  • Retrieve Historical Instances

    I am using the .NET Enterprise SDK.  When I use the code below - I am able to retrieve only Crystal Reports Historical instances.  If I try to retrieve Word or Excel or PDF, I get the following error message on the 325th line (If ReportInterface.ReportParameters.Count > 0 Then):
    Public member 'ReportParameters' on type 'InfoObject' not found.
    Any thoughts as to how to fix this to get the parameters on all datatypes?  In addition, how can I add a hyperlink to the datatable to open the instance (my page to pull instances is called viewer.aspx)?
    Thanks,
    Jeff
        Public Shared Function RetrieveReportInstances(ByVal myInfoStore As InfoStore, ByVal parentID As String) As Data.DataTable
            Dim dt As New Data.DataTable()
            'Declare an array to hold the various statuses that an instance can have.
            Dim status(14) As String
            status(0) = "Active"
            status(1) = "Complete"
            status(3) = "Failed"
            status(4) = "Loaded"
            status(5) = "Loading"
            status(6) = "Not Responding"
            status(7) = "On Hold"
            status(8) = "Paused"
            status(9) = "Scheduled"
            status(10) = "Error"
            status(11) = "Queued"
            status(12) = "Recurring"
            status(13) = "Terminated"
            status(14) = "Terminating"
            'Query for a report.
            'Dim result As String = "Select * From CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' And SI_PARENTID=" & parentID
            Dim result As String = "Select * From CI_INFOOBJECTS Where SI_PARENTID=" & parentID
            Dim myInfoObjects As InfoObjects = myInfoStore.Query(result)
            'Retrieve the first report returned.
            Dim myInfoObject As InfoObject
            If myInfoObjects.Count > 0 Then
                myInfoObject = myInfoObjects.Item(1)
                'Retrieve the report interface.
                Dim ReportInterface = myInfoObject.PluginInterface.Interface
                dt.Columns.Add(New Data.DataColumn("View"))
                dt.Columns.Add(New Data.DataColumn("Owner"))
                dt.Columns.Add(New Data.DataColumn("Run Date"))
                dt.Columns.Add(New Data.DataColumn("Status"))
                dt.Columns.Add(New Data.DataColumn("Duration"))
                If ReportInterface.ReportParameters.Count > 0 Then
                    'Retrieve the database logon information for each database that
                    'the report must logon to.
                    Dim j As Integer
                    Dim ParamName As String
                    For j = 1 To ReportInterface.ReportParameters.Count
                        ParamName = ReportInterface.ReportParameters.Item(j).ParameterName
                        dt.Columns.Add(New Data.DataColumn(ParamName))
                    Next
                Else
                End If
                ' Add some data to the DataTable.
                Dim myDataRow As Data.DataRow
                If myInfoObjects.Count > 0 Then
                    Dim Duration = 0
                    Dim i As Integer = 1
                    For Each myInfoObject In myInfoObjects
                        If myInfoObjects.Item(i).Properties("SI_UISTATUS").Value = 1 Then
                            Duration = FormatTimeSpan((myInfoObjects.Item(i).Properties("SI_ENDTIME").Value - myInfoObjects.Item(i).Properties("SI_NEXTRUNTIME").Value))
                            'Duration = ""
                        Else
                            Duration = ""
                        End If
                        myDataRow = dt.NewRow()
                        myDataRow(0) = myInfoObjects.Item(i).Properties("SI_KIND").Value
                        myDataRow(1) = myInfoObjects.Item(i).Properties("SI_OWNER").Value
                        myDataRow(2) = myInfoObjects.Item(i).Properties("SI_UPDATE_TS").Value
                        myDataRow(3) = status(myInfoObjects.Item(i).Properties("SI_UISTATUS").Value)
                        myDataRow(4) = Duration
                        Dim k As Integer
                        Dim L As Integer
                        For k = 1 To ReportInterface.ReportParameters.Count
                            L = 4 + k
                            myDataRow(L) = ReportInterface.ReportParameters.Item(k).ValueDisplayString
                        Next
                        dt.Rows.Add(myDataRow)
                        i = i + 1
                    Next
                    i = 1
                End If
            Else
                dt.Columns.Add(New Data.DataColumn("Report"))
                Dim myDataRow As Data.DataRow
                myDataRow = dt.NewRow()
                myDataRow(0) = "There are currently no instances of this report."
                dt.Rows.Add(myDataRow)
            End If
            Return dt
        End Function
        Public Shared Function FormatTimeSpan(ByVal time_span As _
            TimeSpan, Optional ByVal whole_seconds As Boolean = _
            True) As String
            Dim txt As String = ""
            If time_span.Days > 0 Then
                txt &= ", " & time_span.Days.ToString() & " days"
                time_span = time_span.Subtract(New _
                    TimeSpan(time_span.Days, 0, 0, 0))
            End If
            If time_span.Hours > 0 Then
                txt &= ", " & time_span.Hours.ToString() & " hours"
                time_span = time_span.Subtract(New TimeSpan(0, _
                    time_span.Hours, 0, 0))
            End If
            If time_span.Minutes > 0 Then
                txt &= ", " & time_span.Minutes.ToString() & " " & _
                    "minutes"
                time_span = time_span.Subtract(New TimeSpan(0, 0, _
                    time_span.Minutes, 0))
            End If
            If whole_seconds Then
                ' Display only whole seconds.
                If time_span.Seconds > 0 Then
                    txt &= ", " & time_span.Seconds.ToString() & " " & _
                        "seconds"
                End If
            Else
                ' Display fractional seconds.
                txt &= ", " & time_span.TotalSeconds.ToString() & " " & _
                    "seconds"
            End If
            ' Remove the leading ", ".
            If txt.Length > 0 Then txt = txt.Substring(2)
            ' Return the result.
            Return txt
        End Function

    Two things:
    1. Scheduled report instances to a different format has a PROGID specific to that format - for example, scheduling to PDF will result in ta instance of PROGID 'CrystalEnterprise.Pdf'.  You'll have to modify your InfoStore query accordingly.
    2. The returned InfoObject will be format specific, and not of type Report.  You'll have to recast the Plugin Interface:
    report = New Report(infoObjects.Item(1).GetPluginInterface("Report"))
    If Version 10 or older, you may try:
    report = New Report(infoObject.Item(1).PluginInterface)
    Sincerely,
    Ted Ueda

  • Retrieving PL/SQL Table Type returned by stored procedure using Java.

    Hi All,
    I am facing an issue in a Stored Procedure (SP) which returns Table Type, the PL/SQL complex type.
    Below mentioned is how my stored procedure looks like.
    CREATE OR REPLACE package sp_test_pkg as
    TYPE v_value_table_type is table of SW_VALID_CODE.swValue%Type
    index by binary_integer;
    v_swRMAStatus v_value_table_type;
    procedure sp_test
    (locale      in int,
              name      in SW_CODE.swName%Type,
              v_value_table out v_value_table_type,
    batch_size in int,
    out_batch_size in out int,
    status out int);
    end sp_test_lcode_code_pkg;
    My java program to access this stored procedure is as given below:
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class OracleTest {       
         public static void main(String args[]) {
         Connection con = null;
    OracleCallableStatement cstmt = null;
    String url = "url";
         String userName = "username";     
         String password = "password";
    try
              DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());     
              con = DriverManager.getConnection(url, userName, password);
         cstmt = (OracleCallableStatement)con.prepareCall("begin " +
              "sp_test_pkg.sp_test_pkg(?,?,?,?,?,?); end;");
              cstmt.setInt(1, 1);
         cstmt.setString(2, "Test");
              cstmt.registerOutParameter(3, OracleTypes.ARRAY);
              cstmt.setInt(4, 10);
              cstmt.setInt(5, 1);
              cstmt.registerOutParameter(5, Types.INTEGER);
              cstmt.registerOutParameter(6, Types.INTEGER);
              cstmt.execute();
    } catch(Exception ex) {
    ex.printStackTrace(System.err);
    } finally {
    if(cstmt != null) try{cstmt.close();}catch(Exception _ex){}
    if(con != null) try{con.close();}catch(Exception _ex){}
    When i execute this java program, i get the following error:
    java.sql.SQLException: Parameter Type Conflict: sqlType=2003
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterBytes(OracleCallableStatement.java:245)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:389)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:452)
         at OracleTest.main(OracleTest.java:49)
    I am not sure where i am going wrong. I have never worked on such complex types before. I want to retrieve the complex table type returned by the stored procedure using my java source code.
    Can anyone please help me out in resolving this issue?. This is very urgent.

    JDBC does not recognise types declared in PL/SQL. This is documented in the Dev Guide. [Find out more|http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/oraarr.htm#1057625].
    The only work around would be to build a wrapper which calls your existing PL/SQL procedures and returns a SQL type instead. Obviously not knowing your precise scenario I have no idea how much work this entails for you. It may be worth building a code generator.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Retrieving Historic Lock Statuses

    Good Afternoon,
    One of our tables on the servers is .dbotblfinreplock and houses all the present & historic data re the work status of entities. In BPC for Excel you can use the EVLCK command to return the latest entry (lock status). My question, is there any command or way in which you can retrieve the historic statuses for a certain time, entity or category from the table in BPC for Excel? 
    Many Thanks in Advance

    Go to BPC-WEB,
    select in the actionpane 'launch BPC System Reports',
    select in the actionpane 'Work Status Report',
    This report should give you a list of all changes made in the workstatus tables.
    Alwin

  • Question about setting column width in SQL*Plus using info retrieved w SQL

    Good morning,
    Is there a way to tell SQL*Plus to set the width of a column to the greatest width of the elements found in the column ? (as opposed to the default which is the width declared in the DDL)
    In other words, I'd like to do something functionally equivalent to this:
    COL <columname> format a[select max(length(<columnname>)) from <thetablethatcontainscolumname>]
    I'm doing the above manually in two steps
    1. select max(length(columnname)) from .....
    2. col columnname format a[resultofstep1]
    Is there a way of doing it in one step ?
    Thank you for your help,
    John.

    Hi Munky,
    >
    you should consider whther you are using the correct tool for the job, SQLplus isn't exactly ideal for doing presentation layer stuff
    >
    I'm not really doing presentation stuff, I asked because it would be very convenient for everyday stuff. I commonly query the tables that I am going to deal withm just to have a look at the column names and a few values, something like:
    select * from EMP where rownum <= 10; -- just to have a look at the table and some values
    when the table contains a wide column then the display gets all messed up. It would be nice to have an option or a mechanism to tell SQL*Plus to automatically use the width of the widest value, instead of having to determine the value and then manually set the column.
    thank you for your help, it's good to know that I didn't miss some trivial setting in the documentation that would do it ;)
    John.

  • Difference in data retrieved from sql developer and sqlplus prompt

    SQL> select distinct snap_time from perfstat.stats$idx_stats;
    SNAP_TIME
    21-MAY-07
    05-JUN-07
    but using sql developer
    select distinct snap_time from perfstat.stats$idx_stats;
    SNAP_TIME
    21-MAY-07
    05-JUN-07
    13-JUN-07
    but can anyone explain the difference because it's the same database

    SQL> select distinct snap_time from
    perfstat.stats$idx_stats;
    SNAP_TIME
    21-MAY-07
    05-JUN-07
    but using sql developer
    select distinct snap_time from
    perfstat.stats$idx_stats;
    SNAP_TIME
    21-MAY-07
    05-JUN-07
    13-JUN-07
    but can anyone explain the difference because it's
    the same databaseIt looks to me during the interim between you run the query in sqlplus and SQL Developer, statspack generated a new snapshot.
    Check your DBA_JOBS see if there's any auto statspack collection job.

  • Retrieving historical data from new ST04

    In the old ST04, you could get a nice, 3 month daily overview of key measures just by hitting "Previous Days".  I use that in my performance analyses.  With the new ST04, I have no idea how that's done.  From my understanding, the new ST04 should give you historical data if you give an initial snapshot date that's far enough back.  But I see no way to define the initial date as anything but "Database Start".  SAP_COLLECTOR_FOR_PERFMONITOR has been running consistently for months. Programs RSORAHCL and RSORAVSH are scheduled to run hourly every day.  So the history should still be there, and should be accessible.  However, the documentation on the new DBACOCKPIT is very sketchy, as far as I've seen.
    Can anyone either point me to some good documentation on this topic, or provide some hints.  I'd very much appreciate it.
    Thanks very much.
                                                       Gordon

    Stefan,
    The system I'm looking at, L6P, is on Basis 7.00 SP 13.  For troubleshooting, I compared L6P to our G8P system , which is on Basis 7.00 SP 15.
    One thing I found is that I can select some dates under the "Database Start" and "Up To Now" buttons on G8P, but not on L6P.  I further found that in table TCOLL, RSORAHCL has all 7 days marked in G8P, but no days marked in L6P.  That would explain why I see the dates in G8P, but not in L6P -- I need to flag the days for RSORAHCL in TCOLL.
    So now, I know what I need to do to pick dates going back as far as what's in AWR, according to dba_hist_snapshot.  I also see how I can change the snapshot interval and retention periods:
    begin
       dbms_workload_repository.modify_snapshot_settings (
          interval => 20,
          retention => 22460
    end;
    for example.  The data's in minutes, so I'd want interval = 1440 and retention = 902460 for 3 months of daily snapshot data.
    However, I still don't see how I can actually see the history.  I go into Statistical Information --> System Summary Metrics, select Metrics Datasource dba-view, and put in the dates I want.  I get a lot of metrics, but I don't see a way to limit them to the sepcific  ones I want (for data buffer hit rate, I think I'll need to get the physical and logical reads).  How can I clean this up to show only what I need?
    Thanks very much.
                                                                    Gordon

Maybe you are looking for

  • PHP iTunes U authentication issue

    I’ve been working with integrating iTunes U with Moodle. On the Moodle site there is an iTunes U block available for integrating the 2 systems. I’ve been trying to use this and I am able to get to the iTunes U site from Moodle, but I am not being sig

  • I can't get Photoshop Elements12 to open from LR5.7 as a plugin. NIK is working fine.

    When I try  to add Elements as a plugin it says an error occurred and will not allow mr to add it. When I installed LR I didn't do anything to add NIK but it is there as a plugin.

  • Can I watch a project's finished video full-screen without exporting?

    I wonder if I can manage my polished videos in FCP 7's projects and watch them in full screen mode just as I have done in Aperture 3 without having to export them first.

  • How to convert Banshee playlists to mpd?

    Does anyone know how to convert Banshee playlists into mpd-readable ones?  mpd doesn't seem to like .m3u playlists exported from Banshee, not much info on this on the web either.  Wondering if this is a solved problem but just not written about much?

  • Can I download CS6 on another computer?

    My computer is old and some of the features are not working correctly. My husbands computer is newer and what is not working on mine will probably work on his. I have seen people say it is ok but you can not be on Photoshop on both computers at the s