COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: ajen7118 on 19 May 2016 04:53:37 PM

Title: Bring all the columns from tabular SQL
Post by: ajen7118 on 19 May 2016 04:53:37 PM
Hello,

I have a tabular SQL and trying to bring all the columns to the report from the tables I joined.

ex:
select *
from A, B, C
where .....

However, it always pops out an error message said "The server returned an unrecognized query framework response"

It will work if I specify
select A.data, A.time, B.cd etc.
from A, B, C
where .....

is there anyway to work around for me to show all the columns? Thank you
Title: Re: Bring all the columns from tabular SQL
Post by: ajen7118 on 25 May 2016 06:14:18 PM
anyone can help?

thanks.
Title: Re: Bring all the columns from tabular SQL
Post by: Lynn on 26 May 2016 01:56:20 AM
You have already identified the work around to show all columns. You need to list them. Once you do that you can include them in the query subject that is fed by the tabular SQL and set any properties as desired or needed.

Is there a reason why this is a problem?

It is not a good practice to use tabular SQL as the preferred approach would be to model your data source properly in Framework Manager and publish a package that can support reporting requirements.

Title: Re: Bring all the columns from tabular SQL
Post by: Michael75 on 26 May 2016 04:48:47 AM
If you absolutely have to use tabular SQL, you can avoid having to specify all the columns by doing

select A.*, B.*, C.*
from A, B, C
Title: Re: Bring all the columns from tabular SQL
Post by: ajen7118 on 21 Jun 2016 01:05:23 PM
Thank you.

The problem is there are some columns with the same columns' name in different tables.

For example,

Table A -- Columns --> CD, name, number, data
Table B -- Columns --> CD, org, div, project
Table C -- Columns --> Org, time, type, lev1name

I am still getting the error to bring in all the columns when I validated the SQL.

Thank you so much for your help.
Title: Re: Bring all the columns from tabular SQL
Post by: bdbits on 21 Jun 2016 02:31:04 PM
You can't ever have multiple columns with the same name in your result set, and the default name is the column name with no qualifiers. There is no way around that.