Help discovering the queries in the database

hi, I have a doubt about oracle. Is there a way to find the SQL of all the select statements, I was using v$_sqlarea, but it doesn't show me all the parameters of the query, some fields of the where clauses are with the value '?'
Is there any kind of way to get the complete select statement?

Hi,
You are getting "?" because the value is parameterised and if you use a bind variable then it will show :1 or something.. the other way of getting ur session sql's is if you are using toad you can get the history of sql's that you have used earlier...
Regards

Similar Messages

  • How to stop Execution of Queries when the Browser closed in middle?

    Hi,
    I have JSP search page, which takes search parameters from previous page runs queries and display the results. I am using connection pool to connect to AS400 database.
    The problem I am facing is... The query still runs on database server, when the user closes browser before getting the search results.
    I am closing all my statements and returning connection to pool at the end of the JSP page.
    Is there any way to terminate the execution of the queries, when the user closes browser?
    Thanks in advance.

    Allright.
    As you know there is no direct way to catch that event, you will have to do this workaround :
    1. Create a class which implements HttpSessionBindingListener. The valueUnbound method will have flag or code to stop running query.
    2. Instantiate this in your search page, and add it into session.
    3. Add javascript in search JSP to access another(dummy) JSP on unload event(to catch browser closing) something like:
    function unload()
    location.href = "/kill.jsp";
    4. The code in dummy JSP will remove the object from session, and will fire valueUnbound method.
    Let me know if this helps.
    -Mak

  • Queries on the web

    All users by default run BEx queries.  Web templates have not been defined.  Can the users still run the queries on the web and if so how?  Do they also have the option to save the query as a favorite? Thanks

    hi Niten,
    yes, there is button 'display query on web (shiftctrlw)' after V and X. you will get a URL like
    http://server:port/sap/bw/BEx?sap-language=EN&bsplanguage=EN&CMD=LDOC&INFOCUBE=infocubename&QUERY=xxx&VARIABLE_SCREEN=..&DUMMY=..
    you should have your bw web-enabled.
    it's running on browser, no option to save as favorite, but they can add in bex analyzer.
    hope this helps.

  • Use of Variable - Refreshing the Queries in Workbook

    Hi All,
    I have a workbook which contains 5 Queries. All these queries uses the same variable. While I am refreshing all the  queries in the workbook, it pops-up the variable input screen 5 times.
    Here I just want the variable screen appear to be once and the same input be taken to all the queries.
    We are in 3.x.
    In 7.x Analyzer, I know that When you have multiple queries(with variables) embedded in a single workbook, we can use "Change Variables" icon to acheive the same.
    How can I achieve this in 3.5.
    Thanks in advance.
    Siva
    Edited by: Siva Reddy S on Jun 9, 2009 10:32 AM

    Hi Joke,
    Thanks for your reply.
    The option "save and reuse variable values" is something to do with the input values to save and reuse the same for the next time execution.
    Here I just wanted to input the variable at one query and the same value needs to be taken to all the queries. The Variable used in all the queries is the same one.
    Thanks again..
    Any body any inputs.
    Siva

  • How to pass an array or structure, in addition to a query, or multiple queries to the Report Builder as parameters

    Is there a way to pass an array or structure for example as parameters, in addition to a query, or multiple queries to the Report Builder in CF8? I believe this was recommended by users to be in CF8.

    BrianO,
    Although it's been a while, I thought I'd provide the code to do this for you. It works for me in CF8, and probably will in CF7.
    Here I create a structure called My, and provide that one parameter to my CFReportParam tag.
    <CFSet My = {
    Client = "Client Name",
    ReportDateFrom = DateFormat(ThisStartDate, DateMask),
    ReportDateTo = DateFormat(ThisEndDate, DateMask),
    PageHeaderImage = ImagePath & "\Logos\Page_Header.png",
    WatermarkImage = ImagePath & "\Logos\Watermark.png",
    GetBarSummary = GetBarSummary,
    GetPieSummary = GetPieSummary
    }>
    <CFReport Template="#ReportPath#\SpendSummary.cfr" Format="PDF" Query="GetSummary">
    <CFReportParam Name="My" Value="#My#">
    </CFReport>
    Inside the report itself, reference the given parameter as Param.My.PageHeaderImage for example. It can be referenced that way from any expression inside the report builder. You can even use the queries as the data source for charts (using the Data From a Query -> Query Builder -> Advanced) by entering "Param.My.GetPieSummary" where it says "Variable containing query object".
    HTH
    Swift

  • Help with these queries

    Hi all,
    I need a help with these queries, because is happening a strange problem when I try to execute it.
    This first query is executed faster than the other one, around 30 minutes faster.
    The queries are the same, but there is a single difference, I switch the hard code value '5.93218%' in a like condition by a variable P_COD_RAIZ || '%', because it can't be hard code.
    SELECT max(oh.ohipp) as mesano_ultfatura
    INTO V_MESANO_FATURA
    FROM sysadm.orderhdr_all@dl_bsc oh,
    customer_all@dl_bsc ca
    WHERE ca.custcode like '5.93218%'
    and ca.customer_id = oh.customer_id
    and oh.ohipp = (select max(yy.ohipp)
    from orderhdr_all@dl_bsc yy
    where yy.customer_id = oh.customer_id
    and oh.ohinvtype = 5);
    SELECT max(oh.ohipp) as mesano_ultfatura
    FROM sysadm.orderhdr_all@dl_bsc oh,
    customer_all@dl_bsc ca
    WHERE ca.custcode like P_COD_RAIZ || '%'
    and ca.customer_id = oh.customer_id
    and oh.ohipp = (select max(yy.ohipp)
    from orderhdr_all@dl_bsc yy
    where yy.customer_id = oh.customer_id
    and oh.ohinvtype = 5);
    What I want to know is, why the execution time of the second query is greater than the first, if the only difference between it is a variable instead of hard code?
    Thanks,
    Murilo.

    I assume column custcode is also varchar2. Then it looks like a problem with bind values and not evenly distributed data.
    When you first run the query with the parameter = '5%' you may get many values and another execution plan as with '5.93218%' on a second run. However the execution plan is saved between the first and second run and not adopted to the new values.
    There are ways out of this "bind" problem. But all have to do with providing us a good execution plan first.
    However you can start by yourself with forcing the use of the index on the column custcode.

  • Refuse the access to the users when the data is loading in cube

    Hi Sap Guy's,
    I have a typical requirement from my client side.
    Requirement:
    While loading data in CUBE update we want have the application that refuse the access to the User's by  showing a message u201C The BW cube u2026. is loading please try lateru201D.
    With this scope we have to modify the chain. Set a parameter before start the cube update and reset the parameter when the cube update is ended.
    The query must be modified for checking the parameter value said above and allow the access or not to the cube.
    Kindly propose a suitable solution for the same.
    Thanks In Advance,
    Krishna.

    Hi,
       This is simple. Create a text element in query description and hardcode this with any dummy value (say the cube name). Fill this text element during i_step = 1 in exit. Use this text element for all the queries on the cube foor which you want this popup message. Then in TVARV table create a field as flag. Before the cube is loaded mark this flag field as X using ABAP program in process chain and once the cube is loaded delete the X for the field. In the exit check in I_STEP = 3 check whether your text element is populated or not. If it is populated this means your query is getting executed. Then check whether your flag field is X or not. If it is X then using the FM raise a popup message RRMS_MESSAGE_HANDLING and after this use the statement raise no_processing. This will return you to selection screen.
      Search the forum for more info abt how to write the code in I_STEP = 3.
    Regards,
    Raghavendra.

  • Grus help needed in finding the queries with Cartesian  joins

    Hi
    I have a reporting tool in which users are allowed to put the joins on the views and add some sub queries that produces a Cartesian product. Is there any tool or way that I can stop the execution of those query before it is being executed for example
    Step 1 ) user creates a query
    step2 ) user submits it
    step 3) by any tool or any check if Cartesian join is found the query execution is stopped and notify the user that the query is not good if no problem executes the query.
    I really need help in step 3. I am on 9i release2.
    Any help or suggestions will be highly appreciated.

    I Agree with Gasparotto, you should limit the resource consume.
    You must understand that cartesian join, isn´t always a BAD guy, sometimes you need it.
    If your developers are in trouble with handle the join , think about NATURAL JOIN, may be it helps you
    Regards
    Helio Dias

  • Help on using 2 MS Access databases at the same time

    I have a problem... see what basically I am trying to do is search for a string in the database 'cache'. if found the second colume is retured to the user as the output. but if not found in that 'cache' then it serches another datbase 'server' and when the req string is found there it has to return the 2nd column to the user but also add this new row in to the 'cache' database.
    The source that I am trying for that is as follows.
    import java.sql.*;
    public class localdemo {
    public static void main(String[] args) {
    String s,r;
    String x;
    String t=args[0];
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    // Test with MS Access database (ODBC data source)
    String url = "jdbc:odbc:Servers";
    String urlc = "jdbc:odbc:cache";
    java.sql.Connection c = DriverManager.getConnection(url,"chetan", "mavric1");
    java.sql.Connection c1 = DriverManager.getConnection(urlc,"chetan", "mavric1");
    java.sql.Statement st = c.createStatement();
    java.sql.Statement stc = c1.createStatement();
    java.sql.ResultSet rs = st.executeQuery("select * from server");
    java.sql.ResultSet rsc = stc.executeQuery("select * from cache");
    //java.sql.ResultSetMetaData md = rs.getMetaData();
    //java.sql.ResultSetMetaData mdc = rsc.getMetaData();
              while(rsc.next()) {
    s=rsc.getString(1);
    if(s.equals(t))
    System.out.print(rsc.getString(2));
         System.exit(1);
    System.out.println("\nDNS Entry not found in the Cache...");
    System.out.println("\nMoving to the Main server database..\n");
    while(rs.next()) {
    r=rs.getString(1);
    if(r.equals(t))
         System.out.print(rs.getString(2));
    String query = "insert into cache(server,ip) values(t,rs.getString(2))";                                                                                     
    int rows = stc.executeUpdate(query);
         stc.close();
    rs.close();
    rsc.close();
    } catch(Exception e) {
    e.printStackTrace();
    it gives me an error
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'rs.getString' in express
    ion.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
    at localdemo.main(localdemo.java:46)
    PLease help
    regards
    Chetan

    Hi ,
    It's always better to acquire resources when ever they are
    going to be used.
    So please change the code as shown below.
    import java.sql.*;
    public class localdemo {
    public static void main(String[] args) {
    String s,r;
    String x;
    String t=args[0];
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    // Test with MS Access database (ODBC data source)
    String url = "jdbc:odbc:Servers";
    String urlc = "jdbc:odbc:cache";
    java.sql.Connection c = null;
    java.sql.Connection c1 = DriverManager.getConnection(urlc,"chetan", "mavric1");
    java.sql.Statement st = null;
    java.sql.Statement stc = c1.createStatement();
    java.sql.ResultSet rs = null;
    java.sql.ResultSet rsc = stc.executeQuery("select * from cache");
    //java.sql.ResultSetMetaData md = rs.getMetaData();
    //java.sql.ResultSetMetaData mdc = rsc.getMetaData();
    while(rsc.next()) {
    s=rsc.getString(1);
    if(s.equals(t))
    System.out.print(rsc.getString(2));
    System.exit(1);
    rsc.close();
    System.out.println("\nDNS Entry not found in the Cache...");
    System.out.println("\nMoving to the Main server database..\n");
    c= DriverManager.getConnection(url,"chetan", "mavric1");;
    st=c.createStatement();
    rs=st.executeQuery("select * from server");
    while(rs.next()) {
    r=rs.getString(1);
    if(r.equals(t))
    System.out.print(rs.getString(2));
    String query = "insert into cache(server,ip) values(t,rs.getString(2))";
    int rows = stc.executeUpdate(query);
    stc.close();
    rs.close();
    } catch(Exception e) {
    e.printStackTrace();
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Sysytems
    http://www.sun.com/developers/support/

  • Help on fetching values form the Database Tables

    Hi,
    I am working on fetching the values from the Oracle base tables.
    First the order will be submitted by the customer. Depending on the city name he mentioned I need to route the order details to two different queues.
    For example if I(customer) insert a list of values(order details) to a table name "X" with the with city name as "San Jose" I need to fetch the values from this table "X" and route them to a Queue"A".
    And again if I insert a list of values to a table name "X" with the with city name as "Milpitas" I need to fetch the values from the table "X" and route them to a Queue"B".
    How do I do this in ESB. I know how to use Database adapter and MQ adapter to create connections between Table and queue.
    Can any one help me on this.
    Thanks
    Ramana.

    Hi Ramana,
    Your use case may be implemented using Oracle ESB like this:
    - Specify a database adapter for reading from DB, your table X. Select an appropriate polling strategy for this. When you finish the wizard, you should have a DB service and get a Routing Service (RS) "for free". The DB service should already be wired to the RS.
    - Specify queuing services add appropriate routing rules with filters (that are based on the message content) and message transformations in your RS in order to route data to the queue of your choice.
    Hth, Sjoerd

  • URGENT HELP How Can I clone the database only?

    Hi all
    I have two database, oracle9.2.0.6 running on RHEL4
    one is testing server and the other for the production server
    how can i clone the testing DATABSE on the productioin DATABASE?
    please help me urgent
    Thank You
    Regards

    Hello Tawfik,
    You can use RMAN duplicate with the following link for 9i.
    http://www.oracle-base.com/articles/9i/DuplicateDatabaseUsingRMAN9i.php
    If you want to clone manually then follow this thread
    Cloning 9i database manually

  • Please help to load image in the database

    Hi to all. ....
    I need to save image file in the database thru forms ...
    I have some image file in the application server and I need to load it in the database in a Blob col..
    Any help ... ??
    Thank's in advance

    Hi!
    Your forms version is very important.
    If you use forms 10g and you want to load the image on the client, you need webutil.
    If you use forms 6 or you want to load the image from the application server to
    a image item in your form, you can use the read_image_file forms build-in:
    read_image_file ( 'x:\path\image.jpg.', 'JPG', 'block.image_item' );On forms 10g this will be executed on the server and the filename and path has to be
    a physical place on your servers harddisk.
    The image item has to be an item of type image and must be assinged to a blob colum in your table.
    Regards

  • Prompts on reports build on direct queries to the database

    Hi,
    Is there a way to create prompts to reports that have been built based on direct queries to the database rather than using a cube?
    I did not find a way to do it, maybe it is not possible at all?
    Regards
    Giuliano

    ok. lets go step by step.
    im assuming that you know how to create a prompt. in the prompt add all the column you wanted i.e
    a.resv_status,a.begin_date,b.last
    select control as "Drop Down list". leave "Show" and "Default to" as defaults. in the set variable select presentation variable and type some name. so lets assume for
    1, a.resv_status variable is resv_status_var
    2, a.begin_date is begin_date_var
    3, b.last is last_var.
    save the prompt.
    now your query is
    select distinct c.room, b.last, b.first, a.resv_status,a.confirmation_no, a.begin_date, a.end_date,d.departure_date as last_stay
    from reservation_name a, name b, reservation_stat_daily c,stay_records d
    where a.name_id=b.name_id
    and a.name_id=c.name_id
    and c.name_id=b.name_id
    and a.resort=c.resort
    and a.resort=b.resort_registered
    and a.confirmation_no=d.crs_book_no
    and a.resort=d.resort
    and a.resv_status= '@{resv_status_var}{02}'
    and a.begin_date = '@{begin_date_var}{02}'
    and b.last = '@{last_var}{02}'
    where 02 is the default value. you can change it as you want. now save the report. go to a dashboard page and add the prompt and report you created in to a same page. now changing the values in prompt will change the report.

  • Help: Build a Quarter Querie Without the 0CALQUARTER

    Hi Experts,
    I need some assistance.
    I have to build a Balance Sheet querie, and I have to do it within 3 time periods: month to month, quarter to quarter and year to year.
    My problem is that I do not have the characteristc 0CALQUARTER in my Infocube, and, I can´t enchance it.
    I only have this time characteristcs:
    0FISCPER3
    0FISCVARNT
    0FISCYEAR
    I can do a formula to calculate each quarter, but the querie will always show all the quarters.
    The problem is that in this way the querie becomes little flexible.
    I need to find a way to calculate the quarter without the 0CALQUARTER, using the initial filters set by user in the initial variables.
    Anyone have a tip? I only have BEx to do it.
    Thanks.
    Eduardo Gonçalves.
    Edited by: Eduardo Carreira Martins Gonçalves on Sep 16, 2009 7:20 PM

    Hi Akhan, thanks for your anwser.
    Well i´m making the queries for BW/BCS. I can´t change the infocube because the BCS consultant already configured the BCS.
    You said to restrict fiscal year, and make a user exit.
    This I think that I can do, but, how can I populate this quarters with fiscal year, in this user exit?
    And what more informations can I give you to help me?
    Thanks again,
    Eduardo Gonçalves.

  • Pl help,i need to validate the data in UI with my database-mysql

    Hello All,
    pl help.
    i'm a newbie with jdbc and mysql
    i'll tell my requirment -i need to check whether the email id in the UI matches with the email id in the db,if the email id exists,i need to find its eid(eid is t priamary key,auto_increment),i've set my email id to be unique key...
    so if the email id matches with the email id in the db,i should get the eid,other wise ,need to insert the email id in the user_table...pl help me with the code.i'm working using exadel and java...need t code 2 do this in java
    pl..pl

    The user comes to the UI and enters the email address and he hits on submit button .... (if i am right)
    it is a simple task of passing the value from jsp to action class and do those operation.
    Can u provide the code that u have wriiten... so that i can help u !!!!

Maybe you are looking for

  • Dump error while Testing the Workflow

    Hi Friends, I have developed workflow for Approve and Reject Scenerio. But when i press Approve, the user should get the mail, same for Rejected also. When Test the Workflow, I am  getting the Dump Error as *Dump Error********* Unable to read RFC des

  • Dragging multiple media clips into vertically stacked tracks in the timeline? Is it possible?

    Hoping that some Adobe Premiere Guru might be able to lend some insight into what seemingly should be a fairly simple thing to accomplish... but despite scouring the web, I can't seem to find a peep of a solution for it. My neighbor (whom, incidental

  • 2 reports on one sheet

    Hallo, I would like to visualize 2 queries under each other on one sheet. Both have almost the same columns, therefore I would like to get the second one directly after the first one (so without title, needless space, etc…). How can I do that? The se

  • Source Table not Partitioned, But destination is, Will Streams Work?

    I want to use Oracle streams to setup replication in a single source environment. Here is what I need to do: I have a sorce data base where tables are not partitioned and oits an OLTP system. I have another DB which has same schema as OLTP, but some

  • Language change on ipod touch

    Please help - I have just returned from turkey where I had to plug my ipod touch into a computer as it had frozen and instructed me to plug into itunes. All my settings are now in Turkish which I dont understand!!! Can anyone tell me how to change th