If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Showing SQL For A Query

Started by Sheldon, 13 May 2010 09:18:00 AM

Previous topic - Next topic

Sheldon

My report is in Page1 which uses Query1.  Now if I create an independent query (Query2) for my own testing purposes, unrelated to Page1, and want to see the SQL for that query, Tools/Show Generated SQL/MDX only shows me the SQL for Query1 and nothing I do seems to allow me to see the SQL for Query2.  Any ideas?

Thanks, Sheldon

CognosPaul

Tool-->Show Generated SQL/MDX will show you the SQL for the objects in the report. Different objects based on the same query can have drastically SQL. You can view the SQL for individual queries by selecting the query through query explorer and clicking on Generated SQL.

Cognos will remove any unused data items when it generates the SQL for each object. For example, if you have a query with Year, Month and Sales the query's generated sql will probably look like:

select year, month, sum(sales) from table group by year, month

If you make a graph showing only years and sales Cognos will automatically remove the month from the SQL making it look like:
select year, sum(sales) from table group by year

Sheldon

Thanks Paul but I had tried what you suggested previously and it hadn't worked.  i.e. No SQL was shown for Query2.  Logically, it seemed like it should've worked...

Sheldon

kattaviz

Hi,

Just drag the Query2 to a seperate page and then try the Generated SQL property for Query2.
thanks & regards
Satish Katta

Sheldon

Thank you Satish.  I went to Query Explorer, highlighted Query2 but I wasn't sure what to do from there.  Should I also be creating a new page first and somehow associate that page (Page2) with Query2? 

Thanks, Sheldon

rockytopmark

Click on Query 2 in the explorer, then go to the properties area, and locate the Show Generated SQL/MDX, and click the ... to have it generate.

Sheldon

Thanks. Highlighting Query2 in Query Explorer, then Properties, then clicking on the ellipsis for Generated SQL worked!
Sheldon