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

Similar Messages

  • 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

  • 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

  • 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.

  • 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

  • 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

  • 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

  • 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.

  • 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

  • SQL query automation and output to text file

    The bcp utility should handle this task pretty easily for you. The documentation is available here.

    I know enough SQL to get me by with the few things I currently do in it (but would always like to know and do more).  Anyway, I was just recently asked if I could come up with a way to automate the execution of a SQL query we currently manually run, and then have the results of that query output (instead of to the screen in SSMS) to a text file with the ".dat" extension.  I've never automated a SQL query before nor have I had the results output to a file.  Can anyone give me some pointers on how to tackle this?
    The query currently calls to a stored procedure (which does all the work) and just executes it with some given dates from the query so I'm thinking the output will need to come from the stored procedure (and the code for output to a file added there?)
    This topic first appeared in the Spiceworks Community

  • Templated report not showing static text/objects on inheriting reports

    Post Author: linksfield-leon
    CA Forum: Crystal Reports
    I have created some basic templates with style/font for all objects on the report as well as some static heading information with parameter fields which will be used in all inheriting reports.However, when applying the template from the file it does not inherit any of the static text/parameters.I've noticed that when I open Crystal Reports 2008 templates, they have red markers on all objects to the left, re-saving this file and then using it as a template does mean that all the static text is inherited.What am I missing here?

    Post Author: linksfield-leon
    CA Forum: Crystal Reports
    Anybody? Please...

  • SQL query to get last 6 months records neglect the current month

    Hi All;
    I need help with 
    sql query to get last 6 months records neglect the current month
    Any help much appreciated
    Thanks
    Pradnya07

    SELECT <> FROM tbl WHERE dt >=dateadd(month,-6,GETDATE())
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Can't add database field or text object to a report (new and existing)

    We have Crystal Report 8.5 and when trying to modify an existing report or create a new report, I can't seem to add any database fields or text objects in my report.  I get a prohibition symbol (circle with a backslash inside it) when I hover over the report.  Has anyone encoutered something like this? Any suggestions?  Thank you.

    Do you have two monitors?
    I had this problem if I tried to open crystal in the second monitor, move it back to primary monitor and it should be OK.
    Ian

  • Get the texts written in the report program

    Hi
    Is there any way(any table /FM) to get  the texts written in the report program .

    Hi
    check this code...
    DATA: itab TYPE string WITH HEADER LINE.
    PARAMETERS: tcode TYPE tstc-tcode.
    PARAMETERS: prog TYPE rs38m-programm.
    IF tcode IS NOT INITIAL.
      SELECT SINGLE pgmna FROM tstc INTO prog WHERE tcode = tcode.
    ENDIF.
    READ REPORT prog INTO itab.
      INSERT REPORT 'YDEV_TEST' FROM itab.
      GENERATE REPORT 'YDEV_TEST'.
      SUBMIT ydev_test VIA SELECTION-SCREEN.
      DELETE REPORT 'YDEV_TEST'.

  • Last Result from Fulltext SQL Query Search Not Showing

    I am creating a custom search results page for MOSS 2007 (using inline .aspx code - don't ask) that uses Fulltext SQL Queries.  I get the results in a ResultTable (see code below) and then use a DataTable to write code to display it (I could have used
    a DataGrid, I know).
    The problem is that the last result is not showing. So, if it reports that there are 5 results, only 4 will show. I have verified that all 5 results do exist (using a slightly broadened query). If it reports 1 result, none exist in the DataTable that loads
    the result data from the ResultTable.
    FullTextSqlQuery query = new FullTextSqlQuery(site);
    query.ResultTypes = ResultType.RelevantResults;
    query.QueryText = qry;
    query.RowLimit = 50;
    query.StartRow = iPage;
    try
    ResultTableCollection results = query.Execute();
    ResultTable resultTable = results[ResultType.RelevantResults];
    DataTable table = new DataTable();
    table.Load(resultTable, LoadOption.OverwriteChanges);
    int n = resultTable.TotalRows;
    The variable "qry" is a valid SQL Query with the relevant clauses.
    I am using a foreach loop to go through "table" (a DataTable), and so I do not think that I have a "one-off error".
    Any suggestions would be most welcome.

    So in results you have all items but when you are loading it into table (type DataTable) you are loosing one last record.
    1) First you check what data you are getting in resultTable - as you are specifying RelevantResult
    2) Check last index of data in ResultTable collection and try to find out the last index ResultTable, or try to find last index of data in result table
    DataTable.Load method accepts parm of type IDataReader and IDatareader, there are cases it looses records if not read properly..check below links
    http://stackoverflow.com/questions/8396656/why-does-my-idatareader-lose-a-row
    http://msdn.microsoft.com/en-us/library/system.data.datatable.load(v=vs.110).aspx
    <hr> Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL <br/> <b><a href="http://insqlserver.com">Everything about SQL Server | Experience inside SQL Server </a></b>-<a href="http://insqlserver.com">Mohammad
    Nizamuddin </a>

Maybe you are looking for