Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
;
WITH cte
AS (
SELECT referenced_variable_name
FROM CATALOG.object_parameters p
WHERE project_id = (
SELECT project_id
FROM CATALOG.projects proj
WHERE proj.NAME = @1
AND proj.folder_id = (
SELECT folder.folder_id
FROM CATALOG.folders folder
WHERE folder.NAME = @2
AND folder.folder_id = (
SELECT environment.folder_id
FROM CATALOG.environments environment
WHERE environment.NAME = @0
)
)
)
)
SELECT referenced_variable_name, CASE eevee.sensitive WHEN 0 THEN 'False' ELSE 'True' END as sensitive, eevee.description, eevee.type as data_type, eevee.value
FROM cte
INNER JOIN CATALOG.environment_variables eevee on eevee.NAME = cte.referenced_variable_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment