COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: BIsrik on 19 Nov 2008 08:09:39 AM

Title: Pass parameter to Manual sql
Post by: BIsrik on 19 Nov 2008 08:09:39 AM
Hi,

How to pass parameter to select clause of manual sql.
I know how to pass in where clause.But when I am trying to put the same in select clause it is throwing error.

So that I want display dynamically the values from date in the report as column which comes through a select clause.

Thanks in Advance.
Title: Re: Pass parameter to Manual sql
Post by: Suraj on 19 Nov 2008 10:32:24 AM
Select
from
where
column = #prompt('Prompt Name')#
-------------------------------------
Okay that was in where clause.
I have some reports that work fine in select clause as well.
What I have is this:
Select col1, col2,
decode(#prompt('Prompt Name')#,'AAA','Triple A','PRG','Progressive','Other') "Group"
from...
where...

and seems to work fine.
Title: Re: Pass parameter to Manual sql
Post by: lindero on 19 Nov 2008 10:40:21 AM
He wants to know how to use it in the select claude. 

Without trying, the following should work.

Select
   #prompt('param_name','token','{defaultcolumn}')# as columnA,
   columnB as columnB,
   columnC as columnC
from
   tableA
...