How Can I find SQL Query in Database

Dear Experts,
How Can I find SQL Query in Database.

Hi,
U mena what query got executed in db? u can try V$SQL for it.
Regards
Bharath

Similar Messages

  • How Can I Execute Sql Query in Managed bean?

    Hi,
    I want to execute sql query in managedbean and get the query result. How can I do?
    Best wishes!

    You can do this by having current Database connection your application is using like this
    public static synchronized DBTransaction getDBTransaction(){
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data}");
    BindingContext bc = (BindingContext)vb.getValue(ctx.getCurrentInstance());
    DataControl dc = bc.findDataControl("AppModuleDataControl");
    ApplicationModuleImpl am = ((ApplicationModuleImpl)(ApplicationModule)dc.getDataProvider());
    return am.getDBTransaction();
    and then user DBTransaction object to create Statement and PreparedStatement you can find those in java doc.

  • How can I get SQL query excution time

    Hi ,
    When I run a query , How can i get total execution time for that query.
    Thanks,
    Regards,
    Basha.

    There are several ways:
    1. In SQL, issue SET TIMING ON
    2. Trace your query:
    - ALTER SESSION SQL_TRACE=TRUE;
    - Execute your query
    - ALTER SESSION SET SQL_TRACE=FALSE
    - Decode the tracefile left at USER_DUMP_DEST using TKPROF.

  • How can i write sql query for this result ?

    Hello Dear,
    Here is the script first.
    CREATE TABLE ACC_TEST(
    AD_ID NUMBER,
    AD_NAME VARCHAR2(50),
    AD_SPM_ID NUMBER);
    /data are
    Insert into ACC_TEST (AD_ID,AD_NAME,AD_SPM_ID) values (136,'Saleh Ahmed',129);
    Insert into ACC_TEST (AD_ID,AD_NAME,AD_SPM_ID) values (142,'Hamidur Rahman',136);
    Insert into ACC_TEST (AD_ID,AD_NAME,AD_SPM_ID) values (124,'Jasim Uddin',null);
    INSERT INTO ACC_TEST (AD_ID,AD_NAME,AD_SPM_ID) VALUES (129,'Sazib',124);I Need The Following Result When I Pass A Value Of Ad_Id. For Example I Pass 142 Then Result Should Be
    Select Ad_Id,Ad_Name
    From..
    where ad_id=142
    Ad_Id   Ad_Name
    136     Saleh Ahmed
    129     Sazib
    124     Jasim Uddin
    If I Pass Ad_Id=136 Then Result Should Be
    Ad_Id   Ad_Name
    129     Sazib
    124     Jasim Uddin
    If I Pass Ad_Id=129 Then Result Should Be
    Ad_Id   Ad_Name
    124     Jasim Uddin Database 10G XE
    Any help will be helpful

    Hi,
    HamidHelal wrote:
    WoW ! you acutely got my point. How did you understand that ? lLuck guess. Guessing is usually not the best way to solve problems. It's usually faster and more reliable to say exactly what you want, as well as give an example.
    ittle bit more i want to know, if i want to restrict the output not more then 2, what would be sql ?Now you're not even giviing an example!
    Maybe you want something like this:
    SELECT     ad_id
    ,     ad_name
    FROM     acc_test
    WHERE     LEVEL     BETWEEN 2 AND 3          -- Changed
    START WITH     ad_id     = :target_ad_id
    CONNECT BY     ad_id     = PRIOR ad_spm_id
    ;which will show jsut the parent and the grandparent of the given row.
    I do work with forms developer very much. Sql knowledge is as oracle sql book(cerfitication 9i). But this type of sql isn't available there.
    where can i learn this type of sql ? Different sql then ordinary ?Certification is a different topic entirely.
    There are books and web sites dealing with more advanced techniques. Sorry, I don't know any well enough to recommend them. Some authors (such as Tom Kyte) are consistently good.
    Here are a couple of sites that explain CONNECT BY queries:
    http://www.adp-gmbh.ch/ora/sql/connect_by.html
    http://www.oradev.com/connect_by.jsp

  • How can we find if an oracle database is involved in GoldenGate replication

    Just by connecting to an oracle database using sqlplus, is there anyway to know if a database is involved in GoldenGate replication?
    i think dba_feature_usage_statistics is one option.
    Thanks
    Sarayu

    Hi,
    The best way that comes to mind is to make a grid where you have the entity and value dimensions on the rows and years and periods on the columns.
    For entities you select the parent and the child you want to look at, value dimension members <Entity Currency> and [Proportion]. For years you select those which you want to look at and all the periods.
    On the grid the [Proportion] should turn from green to red on one of the year/periods and that's the moment your entity became inactive to that parent.
    Hope this helps.

  • How can I find how much material has been delivered for a PO

    Hi
    I status tab of Tcode ME23N there is some data regarding delivered material
    like
    delivered
    ordered
    yet to deliver
    How can i find this data (preferably Database table)
    Thanks

    Hi,
    I believe sap is calculating this information in the program...
    You can use the table EKBE to do the calculation..
    <b>For delivered quantity.</b>
    SELECT * FROM EKBE
                 INTO TABLE T_EKBE
                 WHERE EBELN = 'Input po'
                 AND      EBELP = 'Po line item'
                 AND      VGABE = '1'.    " Material documents.
    LOOP AT T_EKBE.
      IF T_EKBE-SHKZG = 'S'.    " Po delivered.
        V_MENGE = V_MENGE + T_EKBE-MENGE.
      ELSE.
       V_MENGE = V_MENGE - T_EKBE-MENGE.
      ENDIF.
    ENDLOOP.
    SELECT SINGLE * FROM EKPO
                 WHERE EBELN = 'Input po'
                 AND      EBELP = 'Po line item'.
    IF V_MENGE = EKPO-MENGE.
      WRITE: / 'Fully delivered'.
    ELSEIF V_MENGE IS INITIAL.
      WRITE: / 'Not delivered'.
    ELSEIF V_MENGE < EKPO-MENGE.
      WRITE: / 'Partially delivered'.
    ENDIF.
    Thanks,
    Naren

  • How can we find the most usage and lowest usage of table in Sql Server by T-SQL

    how can we find the most usage and lowest usage of table in Sql Server by T-SQL
    The table has time stamp column
    StartedOn datetime
    EndedOn datetime

    The Below query has been used , but the textdata column doesnot include the name of the table ServiceLog.
    SELECT
    FROM
    databasename,
    duration
    fn_trace_gettable('F:\Program
    Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\log_148.trc',
    default)
    WHERE
    DATABASENAME='ZTCFUTURE'
    AND TEXTDATA
    IS
    NOT
    NULL
    --AND TEXTDATA LIKE 'SERVICE%'
    order
    by cpu
    desc; 

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How can I find the schemas used in a database?  Any system table contains?

    How can I find the schemas used in a database? 
    Any system table contains?
    I would like to know sql statement (dictionary object name) which tells the all schema s in a database like dba_users.

    Hello,
    this SQL should help:
    db2 "select schemaname from syscat.schemata"

  • How can i find how many sessions are opened in my database

    Hai
    Iam using Oracle 10g version, front end that iam using is oracle forms6i, sometimes my system get hanged because of some session and not closed i think, can i know how can i find how many session is opened on my database.

    You could query the V$SESSION dynamic view. More info...here...
    HTH!

  • Windows Internal Database on Windows Server 2012 - How can I find out what role or feature is using it?

    We have setup many roles and features and apparently one of them is using the Windows Internal Database (WID). We have had some events logged for WID and need to troubleshoot them. But we are not sure which role/feature is using it. How can I find
    this out?

    Hi,
    Several components of Windows Server 2008 and 2012 use Windows Internal Database for their data storage: Active Directory Rights Management Services, Windows System Resource Manager, UDDI Services, Active Directory Federation Services 2.0, IPAM and Windows
    SharePoint Services.
    Which role did you setup or what is the error message did you received?
    Regards.
    Vivian Wang

  • How can i find statistics tables in my database?

    code{
    Upgrade Statistics Tables Created by the DBMS_STATS Package
    If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by executing the following procedure:
    EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('SYS','dictstattab');
    In the example, 'SYS' is the owner of the statistics table and 'dictstattab' is the name of the statistics table. Execute this procedure for each statistics table.
    the above is one of the post upgrade step for 11gR2. How can i find statistics tables in my database?

    You need to read the complete context of this manual upgrade step:
    Step 33
    Upgrade Statistics Tables Created by the DBMS_STATS Package
    If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by executing the following procedure:
    EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('SYS','dictstattab');
    In the example, 'SYS' is the owner of the statistics table and 'dictstattab' is the name of the statistics table. Execute this procedure for each statistics table.You need to do this step for any statistics table that you created manually with DBMS_STATS.CREATE_STAT_TABLE.
    Marcus

  • How can i make iphone mobile website,  database in Sql Server 2005 ?

    how can i make iphone mobile website,  database in Sql Server 2005 ?
    Thanks & Regards
    Jamshed Ali
    Email id: [email protected]

    You need to be a little clearer in what you're asking.
    You can't make any web site in SQL Server - it's a database engine, not a website tool.
    What you can do is create web sites that pull data from a back-end SQL Server, but the SQL server doesn't handle the client connection at all (that's handled by a web server such as Apache, IIS, or similar).
    There are many ways to build such a site including .NET, PHP, Perl and more (although I don't know all the options for Windows servers because they're not as common outside of corporate/enterprise networks).
    In either case, given your choice of development language (HTML, plus one of the PHP/Perl/.NET/etc. options), plus your database (SQL Server) plus your web server (IIS, Apache, etc.) you can make any web site you like (or, at least, you're capable of developing).
    If you want to opimize that web site for iPhones then there are many references on how mobile browsing differs from the desktop. I'd recommend this book as a reference (and, yes, I understand the irony of linking to a paperback book for web design guidance ). Googling mobile web design (or iPhone web design) might yield more results.

  • How can I find text-item description and content in database?

    I make "Actual news" region with text and simple image items.
    With "Custom Search" autoquery I make news portlet with 10 latest news.
    But I will make with PDK-Java discussion portlet, in which users can read and write about last published (last created text item display name and content) news.
    My questions:
    - How can I find text-item description and content in database?
    - How I can sort text-items to find latest created in my region?
    I have Portal R2
    Thanks in advance.
    Cheslav

    I am sorry. The following are the related tables.
    WWV_TEXT
    WWV_TEXT_BLOCKS
    WWV_TEXT_BLOCK_USAGES
    WWV_USER_TEXT_BLOCKS
    WWV_USER_TEXT_BLOCKS$
    WWV_USER_TEXT_BLOCK_USAGES
    WWV_USER_TEXT_BLOCK_USAGES$
    May be you want to browse WWV_TEXT which is the core table.

  • How can we find out the info object in a query ....?

    How can we find out the info object in a query is belongs to that particular info cube? If the query is built on a Multiprovider having 4 different info cubes.

    Hi,
    If you have restrictions at the infoprovider level in the RKF then it is coming from that particular infocube.
    Or go to the selection option in the multiprovider...her you can get the mappings of which key figure is populted from which infocube.
    For characteristics you will have to look for identification tab in the characteristics option.
    Thanks

Maybe you are looking for

  • Problem with BSP Application

    Hi all, We have three BSP applications running on Production Environment, but after applying Support Patches only two are running , and the third one is not running. But all three applications are running fine in Development, and Consolidation. Here

  • Help!  I need the Comments List to Open in Initial View

    I have Adobe 8 Professional.  I want the Comments List to be set to Open on Initial View, but the Navigation Tab does not have this option.  Is there any way to get this setting? I have Preferences set to open to "Restore Last View", but I think this

  • Hello how can I download iphone contact to my adressbok in my macbook pro

    Hi I wonder if it is possible to import all your contact list from iphone 4s to my adressbook in my macbook pro?

  • Resource for Forms/Database Security

    My company is taking the Oracle plunge in the next 2 weeks and I really need to find some good books, or resources to get off on the right foot. The first thing I would like to deal with is security. I need to figure out how to allow some users to up

  • Exporting HD video for viewing on SD TV

    I have a Panasonic SD9 HD camcorder. I have a standard def widescreen & 4:3 PAL TV. When I edit & export the movie & burn to DVD, the Widescreen SD TV does not show the video in very good quality. I have recorded in full 1080 but the best results are