Hi,
I need to provide the user LOV’s on prompts with the flexibility to type in % and retrieve all values in the report. To achieve the same I have created a condition object in the universe with the following code.
(FUND.CODE IN @Prompt('Enter Fund ',‘A’,‘Fund Details\Fund Code’,Multi,Free) or ‘%’ IN @Prompt('Enter Fund ',‘A’,‘Fund Details\Fund Code’,Multi,Free) ).
When this condition object is included in the report and report is run I get the following error message.
Connection or SQL Sentence Error (DA0005)
Details shows - [Ardent][SQL Client] [RPC] error code=8100181001
Thanks. This works but this solution limits the user to select either one or all values (by entering %). The user wants a flexibility to select either one, multiple or all values.
If you use this it will not find null values (Oracle 9i, so make sure you account for those. We use *.
(@Select(Campaign\Campaign Status Name) IN @Prompt(‘Select Campaign Status’,‘A’,‘Campaign\Campaign Status Name’,multi,constrained) OR @Select(Report Objects\All Campaign Status) in @Prompt(‘Select Campaign Status’,‘A’,‘Campaign History Report\Campaign Status Name’,multi,constrained))
Object All Campaign Status is a literal ‘*’ selected from dual so it parses
You can edit the LOV of the Fund Code object and add the following in the SQL script editor:
SELECT distinct FUND_CODE
FROM TABLE_NAME
union all
SELECT distinct “ALL”
FROM TABLE_NAME;
Click on the check-box “Do not generate SQL before running” and run the query.The value “ALL” should appear in your LOVs.
Now add a pre-defined filter with the folowing code:
FUND.CODE LIKE (CASE WHEN @Prompt('Enter Fund ',‘A’,‘Fund Details\Fund Code’,Multi,Constrained)=‘ALL’ THEN ‘%’ END)
By this mechanism users can either chose one, multiple or ALL from the LOV and run the query.
The LOV SQL should be changed as mentioned by Sumant to including ‘All’ as one of the values using union or union all.
You can use your original code with a small change like below.
(FUND.CODE IN @Prompt('Enter Fund ‘,‘A’,‘Fund Details\Fund Code’,Multi,Free) or All’ IN @Prompt('Enter Fund ',‘A’,‘Fund Details\Fund Code’,Multi,Free) ).