Is it possible to pass parameter in the cognos by SQL?

2.8k Views Asked by At

I am having SQL query as "select * from all_objects where owner = : owner;". Can it be possible to create prompt with this query in cognos 10.2.2.Please suggest me.

1

There are 1 best solutions below

7
Johnsonium On BEST ANSWER

You can use a prompt macro. The SQL with the macro would look something like this:

SELECT * FROM all_objects WHERE owner = #sq(prompt('owner','string',''))#

The third parameter of the prompt() function specifies a default value. If you supply one, the prompt becomes optional.