Dependency Management
You are looking at an older version of the documentation. The latest version is found here.
SYSADMIN.getResourceDependencies
Given a resource name, this system procedure returns all its dependencies:
CREATE FOREIGN PROCEDURE getResourceDependencies(IN resourceName string NOT NULL, IN resourceType string, IN dependencyType string, OUT dependentResourceName string NOT NULL RESULT, OUT dependentResourceType string NOT NULL, OUT parentResourceName string, OUT parentResourceType string, OUT permissionRoleName string, OUT permissionText string)
It takes the following parameters:
Parameter | Description |
---|---|
resourceName | The name of the resource in question. Must include schema name. A '*' can be used to return all dependencies (the default dependency type is used). |
resourceType | Can take one of the following values:
|
dependencyType | Optional, can take one of the following values:
|
Examples
1. All descendants of all elements of the schema are shown, but with only those parent objects which belong to this schema:
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a', 'SCHEMA')) AS a;
2. All descendants of the table are shown, but with this table as a parent and only those other parent objects which are descendants of this table:
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a.test_a', 'TABLE')) AS a;
3. All descendants of view are shown, but with this view as a parent and only those other parents which are descendants of this view:
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a.v_a2', 'VIEW')) AS a;
4. All descendants of the procedure are shown, but with this procedure as a parent and only those other parent objects which are descendants of this procedure:
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a.pr_a3', 'PROC')) AS a;
5. The full dependency graph is shown:
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('*', null)) AS a;
// or
SELECT * FROM (CALL SYSADMIN.getResourceDependencies(resourceName => '*')) AS a;
6. All child objects of the view are shown:
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a.v_a2', 'VIEW', 'CHILDREN')) AS a;
7. All parent objects of the view are shown:
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a.v_a2', 'VIEW', 'PARENTS')) AS a;
SYSADMIN.getViewAndProcCreationOrder
This system procedure gets the creation order of views and procedures:
SYSADMIN.getViewAndProcCreationOrder(OUT creationOrder string NOT NULL RESULT)
Example
SELECT * FROM (CALL SYSADMIN.getViewAndProcCreationOrder()) AS p