COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => SDK => Topic started by: iouwon on 12 Jun 2009 05:17:26 AM

Title: getting the generated sql out of a cognos created query
Post by: iouwon on 12 Jun 2009 05:17:26 AM
Hi,

We have business analysts who create queries using the cognos web app to find clients of our business who they want to target for marketing purposes.  they can export the data via csv and we can feed that into the automated system we're building for them but we expect the size of this data to be in the gigabytes and would like to be able to use the sdk to get at the query definitions of the queries they save in cognos so that we can execute the queries and import the data directly using federation in db2.

We can see from the documentation that a query object contains a reportVersion object which contains an SQL object which it says is the sql generated by the definition of the query.

Does anybody know how to get at this information using the SDK because the properties of the query object don't seem to provide access to the reportVersion object and the reportVersion object doesn't seem to provide access to the SQL object.

Regards,
Luke
Title: Re: getting the generated sql out of a cognos created query
Post by: lindero on 19 Jun 2009 02:29:35 AM
Hi Luke,

maybe this TechNote helps you:

http://www-01.ibm.com/support/docview.wss?uid=swg21344260

cheers,
Lindero
Title: Re: getting the generated sql out of a cognos created query
Post by: iouwon on 19 Jun 2009 06:40:26 AM
brilliant.  that looks perfect.  i'll let you know how i get on
Title: Re: getting the generated sql out of a cognos created query
Post by: jonathanmunge on 30 Sep 2010 03:42:07 AM
Hi the Sample code from the ibm website was great!

However I noticed that the code returns everything from the xml to both the native and cognos SQL is possible to edit it so that it only returns the native SQL?
Title: Re: getting the generated sql out of a cognos created query
Post by: akhanchandani1 on 04 Sep 2020 04:54:13 AM
Hello,

It seems like IBM has removed the URL's

http://www.ibm.com/support/docview.wss?uid=swg21344260

Can some one please help with the sample code, I am specifically looking for extracting SQL queries from Report.

Thanks