Skip to main content
Skip table of contents

Dependency Management

SYSADMIN.getResourceDependencies

Given a resource name, this system procedure returns all its dependencies:

SQL
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:

ParameterDescription
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:

  • PROC: if the resource is a procedure
  • SCHEMA: if the resource is a schema
  • TABLE: if the resource is a table
  • VIEW: if the resource is a view
dependencyType

Optional, can take one of the following values:

  • CHILDREN: (default)to return child objects
  • PARENTS: to return parent objects

Examples

1. All descendants of all elements of the schema are shown, but with only those parent objects which belong to this schema:

SQL
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:

SQL
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:

SQL
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:

SQL
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a.pr_a3', 'PROC')) AS a;

5. The full dependency graph is shown:

SQL
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:

SQL
SELECT * FROM (CALL SYSADMIN.getResourceDependencies('sch_a.v_a2', 'VIEW', 'CHILDREN')) AS a;


7. All parent objects of the view are shown:

SQL
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:

SQL
SYSADMIN.getViewAndProcCreationOrder(OUT creationOrder string NOT NULL RESULT)

Example

SQL
SELECT * FROM (CALL SYSADMIN.getViewAndProcCreationOrder()) AS p
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.