You can translate the question and the replies:

Questions about Define Rule/Plan in Resource Manager

Hi Team, We want to define a rule that when users run query for some views, it needs to add filters on 2 specific columns, otherwise their query will be stopped. Can you have soe custom message when query stopped like: need to filter data with columns XXXX and XXXX. By the way, we see there is an option in the "Plans", called Add variable vaues to the query context, what it is used for? can we use it in our requirement?
user
06-07-2023 10:32:22 -0400
code

1 Answer

Hi, * If you add two *View parameters* to a Selection View created over your view and you use them as *Where Conditions*, the user will be forced to provide these two parameters. See [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) * There's no direct option to check and set custom error messages at view level. What you can do is to create a custom Stored Procedure, see [here](https://community.denodo.com/answers/question/details?questionId=906Du000000017AIAQ&title=views+exclusion+parameters). * The option *Add variables values to query context* is normally used to set [CONTEXT Clause](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/queries_select_statement/context_clause/context_clause) parameters in order to add further restrinction to the user session but you can also define some custom variables that may be read later with [GETVAR('<variable_name>')](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/advanced_characteristics/adding_variables_to_selection_conditions_getvar_and_setvar/adding_variables_to_selection_conditions_getvar_and_setvar#adding-variables-to-selection-conditions-getvar-and-setvar). You can try setting a Context variable with your restriction plan and read it inside your Stored procedure to execute some checks and return the custom messages. Hope this helps
Denodo Team
07-07-2023 08:24:02 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here