You can translate the question and the replies:

COLUMN_DEPENDENCIES procedure

Hi, I would like to run the COLUMN_DEPENDENCIES procedure across all views in a given database to identify columns that have an expression associated to the column. In pseudo code this would look like: ``` select view_name, column_name, expression from COLUMN_DEPENDENCIES () where input_view_database_name = 'db1' and input_view_name in (select view_name from CATALOG_VDP_METADATA_VIEWS('db1') where view_name like 'co%') and expression is not null; ``` Is it possible to write code that executes this logic? Thanks for your assistance.
user
10-11-2021 10:18:20 -0500
code

1 Answer

Hi, The stored procedure [COLUMN_DEPENDENCIES](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/stored_procedures/predefined_stored_procedures/column_dependencies) requires one input parameter as the view name. To get all the columns with a field expression, I would use the Scheduler to create a VDP job and set the parameterized query in the [extraction section](https://community.denodo.com/docs/html/browse/8.0/en/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/vdp_extraction_section#) to SELECT viewname, columnname, expression FROM COLUMN_DEPENDENCIES () WHERE inputviewdatabasename = 'database' AND inputviewname = '@viewslist' AND expression IS NOT NULL; and I set the non-parameterized query from a VDP data source to SELECT DISTINCT viewname AS viewslist FROM CATALOG_VDP_METADATA_VIEWS () WHERE inputdatabasename = 'database'; and exported the results to a csv or any of the available options in the [export section](https://community.denodo.com/docs/html/browse/8.0/en/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/postprocessing_section_exporters) of the job. Hope this helps!
Denodo Team
10-11-2021 16:26:55 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here