If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to Reference Prompt Page Parms in SQL\Macro

Started by TedBell, 31 May 2007 11:22:25 AM

Previous topic - Next topic

TedBell

Hello

I have a built a prompt page that has a parameter defined as 'ctype', which should hold the value the user selects from the prompt. The main report uses an SQL query and macro that will filter based on this user selected item.

How do I reference this value in my main report SQL?

I have tried things such as

where ctype =  #($PromptPage1{$CType})#
where ctype = #?<CType>?#

but I don't seem to have the correct syntax.  Anyone know how this should be done?  Thanks.

COGNOiSe administrator


TedBell

Thanks for the quick response but I get an error using :

where ctype = ?CType?

UDA-SQL-0115 Inappropriate SQL request. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Deferred prepare could not be completed. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Statement(s) could not be prepared. (SQLSTATE=42000, SQLERRORCODE=8180) UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Must declare the variable '@P1CType@P2'. (SQLSTATE  ..........

I have also tried:

= #?CType?#
= #<?CType?>#


Again, I am trying to get  the SQL using macros to resolve the parameter defined in the Prompt Page's value prompt control. Thanks.

COGNOiSe administrator

Could you post a sample built with GOSaR ? (GO Sales & Retailers)

TedBell

Solved! The correct syntax is:

where (CType = #prompt('ComponentType')# )

ComponentType is the parameter defined on my prompt page.