You can translate the question and the replies:

Column dependency using metadata procedures.

I have an requirement to pass list/multiple **ViewName** parameter to *COLUMNDEPENDENCIES* procedure dynamically to get all the dependent views consuming this **ColumnName** parameter across database. **## Metedata Query:** Select column_name, dependency_identifier as dependencyidentifier, view_identifier as viewidentifier, rownum() From COLUMN_DEPENDENCIES ( '**<DatabaseName>**', '**<ViewName>**', '**<ColumnName>**'); Could you please suggest me on this at the earliest. Regards Nagaraja
user
27-04-2018 05:41:13 -0400
code

3 Answers

Hi, I’d use the [COLUMN_DEPENDENCIES()](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/stored_procedures/predefined_stored_procedures/column_dependencies) procedure with a join based on the input_view_name for executing that procedure for different views. For example, I have tried with the [GETELEMENTS()](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/stored_procedures/predefined_stored_procedures/get_elements#get-elements) procedure in a subquery and then joined columns *input_view_database_name *on *input_database_name* as well as *input_view_name* on *name*. Here’s my example but any other subquery returning the view names could be valid for your scenario. ``` Select * from column_dependencies() join ( select * from GET_ELEMENTS() where input_database_name = ‘your_database_name’ and type='view') a on input_view_database_name = input_database_name and input_view_name = a.name ``` Take a look at the [COLUMN_DEPENDENCIES()](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/stored_procedures/predefined_stored_procedures/column_dependencies) section of the Denodo documentation for more information and also at the [Predefined Stored Procedures](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/stored_procedures/predefined_stored_procedures/predefined_stored_procedures#) in general. Hope this helps
Denodo Team
02-05-2018 08:43:33 -0400
code
Incase column we are looking for does not exist for a view then ***column_dependencies() *** procedure throws an error. How we can get all the views consuming a column across database without error ? Thanks and Regards Nagaraja
user
08-05-2018 07:51:02 -0400
In my previous example, there could be a scenario where you are requesting to column_dependencies() information from a column which doesn’t exist. You can solve it by filtering on column_name and leaving input_column_name as null always. For instance, as a workaround I’d tried to filter on column_name as follows: ``` Select * from column_dependencies() join ( select * from GET_ELEMENTS() where input_database_name = ‘your_database_name’ and type='view') a on input_view_database_name = input_database_name and input_view_name = a.name where column_name in (‘column_name_1’, ‘column_name_2’) ``` I’d also suggest to read about[ Predefined Stored Procedures](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/stored_procedures/predefined_stored_procedures/predefined_stored_procedures), too. Hope this helps!
Denodo Team
17-05-2018 12:48:05 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here