COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Query Studio => Topic started by: ale137 on 11 Mar 2020 01:58:15 PM

Title: Best way to create a Query from a SQL
Post by: ale137 on 11 Mar 2020 01:58:15 PM
Hello,
Because of issues beyond my control i have to create a report using only queries with SQL. Im not able to properly create a model.
What would be the more performant way to do this, using a single complex query that gives me all the data, or a series of small queries and i do all the data transformations and joins in cognos?

Thanks
Regards
Title: Re: Best way to create a Query from a SQL
Post by: dougp on 11 Mar 2020 02:48:46 PM
If...

you have the ability to write your own SQL in Cognos,
and you have good SQL skills,
and you know your database, how it is indexed and partitioned,
and all of the data is available through a single data source connection,

...it is likely that one query that returns exactly what you need will perform faster than having Cognos perform joins and do other work.


But...
It also depends on the requirements for the report.  If you need to use Cognos features like nested objects with master-detail relationships...

Check your requirements.  There is no definitive answer to your question.
Title: Re: Best way to create a Query from a SQL
Post by: MFGF on 12 Mar 2020 11:37:35 AM
Quote from: ale137 on 11 Mar 2020 01:58:15 PM
Hello,
Because of issues beyond my control i have to create a report using only queries with SQL. Im not able to properly create a model.
What would be the more performant way to do this, using a single complex query that gives me all the data, or a series of small queries and i do all the data transformations and joins in cognos?

Thanks
Regards

To add to what Doug wrote above, If you are using Query Studio (you posted this question in the Query Studio board) you cannot use SQL directly. You'd need to use Report Studio to be able to do this, and you'd also need the SQL capability granted to you by your Cognos Administrator.

Cheers!

MF.