Crystal's "Show SQL Query" like feature for OracleReports

Dear experts, after finding the solution for RDf to CrystalRPT conversion, i need to ask 3 possiblities rather asking the same solution millionth time :)..
1. Does oracle have some tool, internal lab built etc as seperate downloadable to serve as Crystal's "Show SQL Query".
2. Can OracleDesigner, OracleDiscoverer help in this regard, i found no Import RDF feature there
3. Can Oracle Optmizer be intercepted to show what resultant SQL(s) it ran for that report.
4. Is there any way to intercept, diagnnose the SQL runing at Database so we grab the SQLs from there.
I have opened an RDF in Notepad and though SQLs etc are visible unencrypted still it seems work of months or years for me.
very thank full.

Can v$session, v$sql http://www.oracle-training.cc/oracle_tips_v$sql.htm help for this... how to see which SQLs are sent by a particular report by a particular machine.

Similar Messages

  • How to enable show SQL Query in Crystal report tool

    Hi,
    How can we enable the show SQL Query under Database tab in crystal report...
    We have a requirement to modify the SQL query in Crystal reports.
    Thanks,
    Gana

    Gana,
    CR has an "Add Command" feature that will allow you to use hand-coded SQL as your data source.
    Look at Defining an SQL Command in CR's online help (F1).
    If a command was used in the original report creation, it's a simple matter to go in and edit that SQL.
    If the report was not originally built w/ a Command you may find it difficult to switch over. In most cases it easier to start over from scratch, creating a new, blank report, that uses the command.
    Jason

  • Database - Show SQL Query question..

    Greetings:
        I am helping a co-worker with Crystal. I don't use crystal but I am able to explain the problem. My co worker is currently using crystal reports 8.5. If he pulls a query and the report is generated he can then click on Database menu then click on Show SQL Query. From there he is able to edit, add, remove fields. Now we want to place him on Crystal V10. When he does the same task, instead of being able to edit the Show SQL query he can only view it. Is there a way around this so that he can Edit the sql query in version 10 or did that feature go away in versions 9 and above. Also we are going to Purchase Crystal 2008, is this feature available in 08? Any help would be appreicated..

    Hi there!
    I have the same problem as described above.  I have been asked to figure out what is wrong with one of the reports that used to work when we used MAS 4.05.  We are now on MAS 4.20 with Crystal Reports v.10 and the report fails to run.  I loaded the report into Crystal to see if I could see the problem and I discovered that the report is still trying to access a table from the old MAS database.  The SQL code as shown in the Show SQL Query window is as follows:
    SELECT "AR_InvoiceHistoryHeader"."InvoiceNo", "AR_InvoiceHistoryDetail"."ItemCodeDesc", "AR_InvoiceHistoryDetail"."ItemCode", "AR_InvoiceHistoryDetail"."ExtensionAmt"
    FROM   "AR_InvoiceHistoryHeader" "AR_InvoiceHistoryHeader", "AR_InvoiceHistoryDetail" "AR_InvoiceHistoryDetail"   
    WHERE  "AR_InvoiceHistoryHeader"."InvoiceNo"="AR_InvoiceHistoryDetail"."InvoiceNo" AND "AR_InvoiceHistoryHeader"."HeaderSeqNo"="AR_InvoiceHistoryDetail"."HeaderSeqNo" AND "AR_InvoiceHistoryHeader"."CommissionAmt"="AR_InvoiceHistoryDetail"."CommissionAmt" AND      ARO_InvHistoryDetail."SOItemNumber" <> 'COMMENT' AND      ARN_InvHistoryHeader."InvoiceDate" = {d '2007-09-21'}  
    ORDER BY "AR_InvoiceHistoryHeader"."InvoiceNo"
    The problem is that ARN_InvHistoryHeader needs to be AR_InvoiceHistoryHeader and SOItemNumber needs to be ItemCode.
    When I go into the Database Expert, I can only see the tables in the FROM clause.  I don't know how to modify the WHERE clause.  It kind of looks like this report was only partially converted to the new version.  Is there a way to changed these attributes without rebuilding the whole report?
    By the way, I apologize for not setting my SQL off in a code box, but I tried that and it caused the page to be very wide with no horizontal scroll bar.
    Edited by: Jason Schill on Oct 27, 2008 11:30 PM

  • Show SQL Query

    I've inherited many existing reports.  They all access stored procedures in SQL Server 2000.  As I've been trying to study them, I've noticed a major disconnect between the sproc referenced in Database Expert and the 'Show SQL Query' window.  How can I sync these up?  And how can I modify the sproc call that's referenced within the Show SQL Query?  Using VS .Net, I've even looked at the underlying class file, and cannot find any reference to the actual sproc call.
    Thanks.
    Dave

    Hi David,
    Open the report in Crystal and go to Database | Set Datasournce Location.  You will then be able to logon to your database and select the Stored Procedure you want.  You will be prompted to set the parameters if there are any and chances are you will get a message saying the database has changed and asking if you want to update the report.  Say yes to that and the report should be using the updated Stored Procedure now. 
    Unlike tables, Crystal is calling the Stored Procedure and executing it.  This is why you can't see the code for the query and just the Call. 
    Good luck,
    Brian

  • What Option Allows Permanent Change of Query in the Show SQL Query Window?

    I am trying to create a report in Crystal Reports v8.5 (or v10).  I would like to create the report by simply cutting and pasting an SQL query from SQL Designer into the appropriate place in Crystal Reports.  I can paste the query into the "Show SQL Query" window, but it reverts back to something else.  What Option do I change to allow me to do that, i.e, change the query in the "Show SQL Query" window?

    Hi Alan,
    In CR10 there is no option to past SQL qurety in Show Sql command option.  There is another option provided 'Add Commad' to execute customized SQL queries.  After connecting to your datasource before selecting tables you can choose Add Command option and past your SQL queries.
    Also you can modify the queries which you have pasted in add command.
    Thanks,
    Sastry

  • Discoverer Report showing Null VS Show SQL query showing results !!!

    I created a simple Cross Tab Discoverer report from a custom SQL which has a calculation for balances. The output is giving all null values even though there are balances. The output doesn't seem right. So I copied the query from Tools-->Show SQL and ran the query in the TOAD where I'm showing balances for the report. I don't understand why it is not showing in the discoverer. Please help.
    Thanks
    Edited by: PA1B on Jan 27, 2010 11:40 AM

    Sorry for late reply.
    Below is the Show SQL query. I don't think the query is application dependent. C_1 is my calculation.
    SELECT o279709.SEGMENT3 as E279727,
    o279709.SEGMENT4 as E279728,
    CASE WHEN o279709.CURRENCY_CODE = 'USD' AND o279709.TRANSLATED_FLAG <> 'Y' THEN SUM(o279709.ENDING_BAL) ELSE 0 END as C_1,
    GROUPING_ID(o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG) as GID
    FROM ( --Foriegn Entity USD Balances
    SELECT                B.SEGMENT1,
                                       B.SEGMENT2,     
                                       B.SEGMENT3,
                                  (select distinct substr(cat.COMPILED_VALUE_ATTRIBUTES,5,1) from apps.fnd_flex_values cat
                   where FLEX_VALUE_SET_ID = (select bat.FLEX_VALUE_SET_ID from apps.fnd_id_flex_structures_vl aat, apps.fnd_id_flex_segments_vl bat
                                                                                                                       where bat.id_flex_code = 'GL#' and
                                                                                                                            bat.id_flex_code = aat.id_flex_code and
                                                                                                                            aat.APPLICATION_ID = bat.APPLICATION_ID and
                                                                                                                            aat.APPLICATION_ID = 101 and
                                                                                                                            bat.SEGMENT_NAME = 'Prime Account' and
                                                                                                                            aat.id_flex_num = bat.id_flex_num
                                                                                                                            and bat.id_flex_num in (select distinct chart_of_accounts_id from apps.gl_code_combinations gat
                                                                                                                                                                              where gat.code_combination_id = A.code_combination_id))
                                       and cat.flex_value = b.segment3) ACCT_TYPE ,
                                       B.SEGMENT4,
                                       B.SEGMENT5,
                                       B.SEGMENT6,
                                       B.SEGMENT7,
                                       B.SEGMENT8,
                                       B.SEGMENT9,
                                       B.SEGMENT10,
                                       B.SEGMENT11,
                                       B.SEGMENT12,
                                       B.SEGMENT13,
                                       C.NAME,
    A.SET_OF_BOOKS_ID,
                                       A.CURRENCY_CODE,A.TRANSLATED_FLAG,
                                  SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0)) BEG_BAL,
                                  SUM(NVL(A.PERIOD_NET_DR,0)) DEBITS,
    SUM( NVL(A.PERIOD_NET_CR,0)) CREDITS ,
    A.PERIOD_NAME,
                                  SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0))+ SUM(NVL(A.PERIOD_NET_DR,0) - NVL(A.PERIOD_NET_CR,0)) ENDING_BAL
    FROM                     APPS.GL_BALANCES A ,
                                       APPS.GL_CODE_COMBINATIONS B,
                                       APPS.GL_SETS_OF_BOOKS     C
    WHERE                     A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID
    --AND                           A.PERIOD_NAME = 'SEP-09'
    AND                          C.SET_OF_BOOKS_ID = A.SET_OF_BOOKS_ID
    --AND                           A.TRANSLATED_FLAG <> 'Y'
    --AND                           B.SEGMENT1 = '83101'
    --AND                           B.SEGMENT3 = '14602'
    --AND                           A.SET_OF_BOOKS_ID = 77
    --AND                           A.CURRENCY_CODE = 'USD'
    GROUP BY           A.CODE_COMBINATION_ID,
                                  B.SEGMENT1,
                                       B.SEGMENT2,     
                                       B.SEGMENT3,
                                       B.SEGMENT4,
                                       B.SEGMENT5,
                                       B.SEGMENT6,
                                       B.SEGMENT7,
                                       B.SEGMENT8,
                                       B.SEGMENT9,
                                       B.SEGMENT10,
                                       B.SEGMENT11,
                                       B.SEGMENT12,
                                       B.SEGMENT13,          
                                       A.CURRENCY_CODE,
                                       A.TRANSLATED_FLAG,
                                       C.NAME,A.PERIOD_NAME,
    A.SET_OF_BOOKS_ID
    ) o279709
    WHERE (o279709.PERIOD_NAME = 'DEC-09')
    AND (o279709.SET_OF_BOOKS_ID <> 72)
    AND (o279709.SEGMENT12 = '000')
    AND (o279709.SEGMENT3 IN ('10101','10301','10502','12001'))
    AND (o279709.SEGMENT1 IN ('82901','82902','82903','83001','83003','83201'))
    GROUP BY GROUPING SETS(( o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG ),( o279709.SEGMENT3,o279709.SEGMENT4 ),( o279709.SEGMENT3 ))
    HAVING (GROUP_ID()=0)
    ORDER BY GID DESC;
    Thanks,
    PA1
    Edited by: PA1B on Jan 29, 2010 12:50 PM

  • Show SQL Query is Incorrect

    Crystal 11.5.0.313
    I removed all conditions from the Select Expert but when I go to Database, Show SQL Query it includes a WHERE condition that is restricting the data.  The report doesn't have any commands but one may have existed in the past.  Is my report corrupt or something? How do I get it to "refresh" that SQL Query without having to recreate the whole report.
    Thanks.
    Edited by: mar123 on Jul 17, 2009 1:04 AM
    Edited by: mar123 on Jul 17, 2009 1:05 AM

    Hi,
    Try to update datasource from .Database Expert->Set datasource.
    Now refresh the report.
    Regards,
    Shweta

  • Can we implement the custom sql query in CR for joining the two tables

    Hi All,
    Is there anyway to implement the custom sql query in CR for joining the two tables?
    My requirement here is I need to write sql logics for joining the two tables...
    Thanks,
    Gana

    In the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
    Log on to your data source if necessary.
    Under your data source, double-click the Add Command node.
    In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.
    For example:
    SELECT
        Customer.`Customer ID`,
        Customer.`Customer Name`,
        Customer.`Last Year's Sales`,
        Customer.`Region`,
        Customer.`Country`,
        Orders.`Order Amount`,
        Orders.`Customer ID`,
        Orders.`Order Date`
    FROM
        Customer Customer INNER JOIN Orders Orders ON
            Customer.`Customer ID` = Orders.`Customer ID`
    WHERE
        (Customer.`Country` = 'USA' OR
        Customer.`Country` = 'Canada') AND
        Customer.`Last Year's Sales` < 10000.
    ORDER BY
        Customer.`Country` ASC,
        Customer.`Region` ASC
    Note: The use of double or single quotes (and other SQL syntax) is determined by the database driver used by your report. You must, however, manually add the quotes and other elements of the syntax as you create the command.
    Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.
    For more information about creating parameters, see To create a parameter for a command object.
    Click OK.
    You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.
    Note:
    To construct the virtual table from your Command, the command must be executed once. If the command has parameters, you will be prompted to enter values for each one.
    By default, your command is called Command. You can change its alias by selecting it and pressing F2.

  • Show SQL Query Info

    It seems every portal user can use 'Show SQL Query Info' at application component manage page. How to disable it?

    In case anyone is interested I found 2 methods to get round this problem:
    1. First if you are calling the url directly you may need to convert some characters to their hexidecimal equivalent to make this be interpreted correctly by the browser.
    i.e. Space = %20
    % character = %25
    & character = %26
    So in the example I used this would become:
    ?p_arg_names=costcentre&p_arg_values=B15&p_arg_names=projsearch=%25Teach%25
    Binding:
    :cost_centre binding with B15
    :projsearch binding with %Teach%
    2. The second method is to use a pl/sql stored procedure to call the report passing the parameters in as follows.
    PORTAL_CUST.P11_PROJECT_SEARCH_RESULTS.show (
    p_arg_names => PORTAL.wwv_standard_util.string_to_table2 (
    'parameter1:' ||
    'parameter2'),
    p_arg_values => PORTAL.wwv_standard_util.string_to_table2 (
    p_parameter1_value || ':' ||
    p_parameter2_value));
    Cheers,
    Gary.

  • Show SQL Query to be showed in Text object at the report

    Is there any way where I can take/copy the query showed in "Database->Show SQL Query" to be showed as a field in a TextBox inside the report.
    So it is a bit clearer what I am trying to do, it is to get who, when and what runs that report.
    Thanks in advance
    Tonio

    Hi Toni,
    I am not sure if I have understood your requirement. If you could elaborate what you are trying to do then i may be able to help.
    I understand you want to copy the query which is displayed in DATABASE->Show query name... I hope u are refering to SQ01 trx...
    I am not sure what next part..
    Rgds
    Abhijit

  • What SQL query I need for this?

    I need to execute a SQL query but I don't know how.
    To illustrate it, please take a look at some example data:
        ARTICLEID SOLDON    
        1         2005-12-31
        1         2005-11-31
        1         2005-10-31
        1         2005-09-31
        1         2005-08-31
        1         2005-07-31
        1         2005-06-31
        1         2005-05-31
        1         2005-04-31
        1         2005-03-31
        1         2005-02-31
        1         2005-01-31
        1         2004-12-31
        1         2004-11-31
        2         2005-12-31
        2         2005-11-31
        2         2005-10-31
        2         2005-09-31 This is a piece of the sales data for the articles (sales history).
    Lets assume that today is the date 2005-12-31.
    Two requirements for the query:
    1. Get the sales data for the last 12 months.
    2. Get only the sales data for articles where there is sales data since at least 6 months.
    The result in my example should look like this:
        ARTICLEID SOLDON    
        1         2005-12-31
        1         2005-11-31
        1         2005-10-31
        1         2005-09-31
        1         2005-08-31
        1         2005-07-31
        1         2005-06-31
        1         2005-05-31
        1         2005-04-31
        1         2005-03-31
        1         2005-02-31
        1         2005-01-31 What is the SQL which I need to accomplish this query?

    To get all the information from the last 12 months
    you will have to use date manipulation.
    SELECT add_months(sysdate, -12) from
    dual;This gives you the date 12 months ago.
    So you will have to select your date between then and
    the current date.If I do this I will get this data:
        ARTICLEID SOLDON    
        1         2005-12-31
        1         2005-11-31
        1         2005-10-31
        1         2005-09-31
        1         2005-08-31
        1         2005-07-31
        1         2005-06-31
        1         2005-05-31
        1         2005-04-31
        1         2005-03-31
        1         2005-02-31
        1         2005-01-31
        2         2005-12-31
        2         2005-11-31
        2         2005-10-31
        2         2005-09-31 But I want this data:
        ARTICLEID SOLDON    
        1         2005-12-31
        1         2005-11-31
        1         2005-10-31
        1         2005-09-31
        1         2005-08-31
        1         2005-07-31
        1         2005-06-31
        1         2005-05-31
        1         2005-04-31
        1         2005-03-31
        1         2005-02-31
        1         2005-01-31 I am no native English speaker. What didn't you understand in the two requirements?
    Here are my two requirements for the query:
    1. Get the sales data for the last 12 months.
    2. But get ONLY the sales data for articles where there is sales data since AT LEAST 6 months.
    The result can contain as many IDs as you want if the two requirements are met. Its not a trivial SQL statement for me. Please remember that the above data are only for illustration. They are just an example.
    There should be a SQL statement for this.
    Please tell me if you don't understand my problem. I will try to explain it in a better way if I can.

  • SQL Query to search for most and least popular brands bought by spesific client and total

    Hi to SQL query masters!
    I need to create a report on most and least popular brand names within one specific client orders.
    For example, during last month or a year among 100% of specific client's orders were 70% IBM products, 20% of HP and 10% Lenovo products.
    How do I do that?
    And I also think that it might be useful to have a query that shows top popular brands among all sales in given period of time – this statistic might improve warehouse turnover and marketing activities on least popular brand names.
    I tried to use info from this link, but it didn’t help https://websmp106.sap-ag.de/~form/sapnet?_SCENARIO=01100035870000000183&_FRAME=OBJECT&_HIER_KEY=701100035871000439554&
    Kind regards,
    Ilya.

    Hi
    Please Check this
    SELECT COUNT (T2.[CardCode]) as 'no of sales', T3.ItmsGrpNam,T2.Cardname
    FROM rdr1 T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN ORDR T2 ON T0.DocEntry = T2.DocEntry
    INNER JOIN OITB T3 ON T1.ItmsGrpCod = T3.ItmsGrpCod
    WHERE T2.[DocDate] >= [%0] and  T2.[DocDate] <= [%1]
    GROUP BY T3.ItmsGrpNam,T2.Cardname
    ORDER BY COUNT (T2.[cardcode]) desc

  • SQL Query Assistance Required for Full Outer Join

    Hi,
    Lets say I have two tables, i.e:
    TAB_A (colA1, colA2, colA3, colA4)
    TAB_B (colB1, colB2, colB3, colB4) where colB2 is a FK to colA1
    I am after an SQL query that will cater for both the following two scenarios.
    Scenario 1:
    TAB_A has two rows of data, i.e
    (1, ABC100, 1, WG_A)
    (2, ABC100, 2, WG_B)
    TAB_B has one row of data, i.e
    (1, 1, EMP_222, 4)
    I use the following SQL:
    select a.*, b.*
    from tab_a a FULL OUTER JOIN tab_b b ON (a.colA1 = b.colB2)
    where a.colA2 = 'ABC100'
    This returns two rows:
    1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
    2, ABC100, 2, WG_B
    Now, what I actually would like my query to do is actually only return the row where a tab_b record exists, i.e, should only return one record:
    1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
    This I can achieve by using a RIGHT OUTER JOIN instead above, but this causes issue with my scenario 2, which is the following set-up
    Scenario 2:
    TAB_A has only one row of data this time, i.e
    (2, ABC100, 2, WG_B)
    TAB_B has no data at all this time
    This returns no rows but I actually now want this single record from tab_a returned.
    I basically require an SQL query that will cater for both the top 2 scenarios, i.e, if a tab_b record exists from the outer join then only return this record along with tab_a data. If a tab_b record doesn't exist, then only return the tab_a record.
    Hope the above makes sense.
    Thanks.

    Is it what you need (not very elegant) ?
    SQL> select * from t_outer;
            ID CODE
             1 100
             2 100
    SQL> select * from t_inner;
    no rows selected
    SQL> with tab1 as (
      2  select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
      3  (a.id = b.id and a.code = '100'))
      4  select * from tab1
      5  union all
      6  select a.*, null from t_outer a where not exists (
      7  select 1 from tab1)
      8  and a.code = '100'
      9  /
          A_ID CODE             B_ID
             1 100
             2 100
    SQL> insert into t_inner values(2);
    1 row created.
    SQL> with tab1 as (
      2  select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
      3  (a.id = b.id and a.code = '100'))
      4  select * from tab1
      5  union all
      6  select a.*, null from t_outer a where not exists (
      7  select 1 from tab1)
      8  and a.code = '100'
      9  /
          A_ID CODE             B_ID
             2 100                 2
    Rgds.

  • SQL Query Too Large For Report Region

    Oracle Friends:
    I have a SQL query that is 24,000 characters long. APEX fails when I try to create a report using this query, probably because it is too long.
    I get an "ORA-01461: can bind a LONG value only for insert into a LONG column" after I paste it and try to go to the next page.
    Any ideas? I can't make my query any smaller without creating intermediate tables.
    Any help would be most appreciated.
    Regards,
    Rich Locus

    Hi,
    If possible, try to reduce the no. of characters from your SQL query. Ex. use shorter aliases etc in your query. Also, as suggested above, create some views which can form a part of your query and then use those views in your main query to reduce the total no. of characters.
    The report region source can take some limited no. of characters only. Exact figure is not known to me.
    Try the above suggestion and see if this works or not.
    Regards,
    Mangal

  • Sql query - been trying for two days

    Hi guys im trying to carry out an sql query
    Im using a left join to do a query, which gives me a set of results:
    select COURSESTUDENT.StudentNo, COURSESTUDENT.CourseCode, COURSESTUDENT.Year, MARKS.ExamMark, MARKS.EntryNo FROM COURSESTUDENT LEFT JOIN MARKS ON COURSESTUDENT.StudentNo=MARKS.StudentNo AND COURSESTUDENT.CourseCode=MARKS.CourseCode AND COURSESTUDENT.Year=MARKS.Year
    but I would like to do a select on this result but do not want to use a create view as if more than one person access this page at a time then if the servlet tries to create the view an error will occur.
    I would like to do the following select statement on the results of the query above..
    select * from (above) where CourseCode='ELE304' AND Year=1999;
    Is this possible, im using postgres..
    Please help......
    thanks
    tzaf

    just add "where ..." to the end of the first query.

Maybe you are looking for