sa_dependent_views system procedure

Returns the list of all dependent views for a given table or view.

Syntax
sa_dependent_views( 'tbl_name ' [, ' owner_name ' )
Arguments
  • tbl_name   Use this CHARACTER parameter to specify the name of the table or view.

  • owner_name   Use this optional CHARACTER parameter to specify the owner for tbl_name.

Result set
Column name Data type Description
table_id UNSIGNED INTEGER The object ID of the table or view.
dep_view_id UNSIGNED INTEGER The object ID of the dependent views.
Remarks

Use this procedure to obtain the list of IDs of dependent views. Alternatively, you can use the procedure in a statement that returns more information about the views, such as their names.

No errors are generated if no existing tables satisfy the specified criteria for table and owner names. Also:

  • table_name is optional and has a default value of null.

  • If both owner and table_name are null, information is returned on all tables that have dependent views.

  • If table_name is null but owner is specified, information is returned on all tables owned by the specified owner.

  • If table_name is specified but owner is null, information is returned on any one of the tables with the specified name.

By default, execution of the procedure does not require any permissions and assumes that PUBLIC has access to the catalog. DBAs can control access as needed on the view and/or the catalog.

Permissions

None

Side effects

None

See also
Examples

In this example, the sa_dependent_views system procedure is used to obtain the list of IDs for the views that are dependent on the SalesOrders table. The procedure returns the table_id for SalesOrders, and the dep_view_id for the dependent view, ViewSalesOrders.

sa_dependent_views( 'SalesOrders' );

In this example, the sa_dependent_views system procedure is used in a SELECT statement to obtain the list of names of views dependent on the SalesOrders table. The procedure returns the ViewSalesOrders view.

SELECT t.table_name FROM SYSTAB t,  
sa_dependent_views( 'SalesOrders' ) v 
WHERE t.table_id = v.dep_view_id;