You can translate the question and the replies:

in selection view, is there any way that input parameter can accept values from subquery rather direct assignment

in selection view, is there any way that input view parameter can accept values from subquery rather direct assignment of values. if i assign values through sun query like below ``` SELECT GETDAYSBETWEEN(in_from_effective_date, in_to_effective_date), p_portfolio_asset_dm.* FROM p_portfolio_asset_dm AS p_portfolio_asset_dm WHERE in_from_effective_date = '31-JAN-1992 00:00:00' AND in_to_effective_date = '31-MAR-1992 00:00:00' AND in_data_source_code = 'FPCMS' AND in_view_code in (select 'EOS' from dual()) ``` getting below error **Finished with error: No search methods ready to be run. The following fields are obligatory: p_portfolio_asset_dm.in_view_code**
user
09-01-2020 04:54:25 -0500

1 Answer

Hi, In the past, I have received the same error. It happened because I was trying to assign the result of a subquery to a view parameter. As mentioned in the [Parameters of Derived Views](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/creating_derived_views/creating_selection_views/creating_selection_views#parameters-of-derived-views) section of the Virtual DataPort Administration Guide, this should not be done since the subquery will not be evaluated as expected. More specifically, if a default value was specified, then that value will always be assigned as the result of the subquery. Otherwise, if no default value was specified, then executing the view will produce the error you received. If you want to pass a value from one view to another, it can be accomplished with the following steps: 1. Create a view over the subquery. For example: ``` CREATE VIEW view1 AS SELECT 'EOS' AS value FROM dual(); ``` 2. Create a join view with a condition such that the result returned by "view1" is passed to the view parameter in "p_portfolio_asset_dm": ``` p_portfolio_asset_dm.in_view_code = view1.value ``` Now, the result of the subquery will be used when executing the join view. You can take a look at the VQL tab of the view to verify the query. Hope this helps!
Denodo Team
10-01-2020 19:26:28 -0500
You must sign in to add an answer. If you do not have an account, you can register here