Cloudscape System Tables
Page 7 of 17

SYSDEPENDS

Describes the dependency relationships between persistent objects in the database. Persistent objects can be dependents (they depend on other objects) and/or providers (other objects depend on them). When the user attempts to drop or modify a provider, Cloudscape checks to see if there are any current dependents. If there are, one of the following actions will occur:

  • If the dependent is not a stored prepared statement, an exception is thrown saying that the dependents must be dropped first before dropping the provider.
  • If the dependent is a stored prepared statement, it will be marked as needing recompilation.

Providers are tables, conglomerates, and constraints. Dependents are publications, views, and stored prepared statements.

Column Name

Type

Length

Nullable

Contents

DEPENDENTID

CHAR

36

false

unique identifier for the dependent

DEPENDENTFINDER

SERIALIZE
(COM.cloudscape.
types.
DependableFinder
)

1

false

system type describing the publication, view, or stored prepared statement

PROVIDERID

CHAR

36

false

unique identifier for the provider

PROVIDERFINDER

SERIALIZE
(COM.cloudscape.
types.
DependableFinder
)

1

false

system type describing the tables, conglomerates, and constraints that are providers

Indexes

  • SYSDEPENDS_INDEX1 BTREE index on (DEPENDENTID)
  • SYSDEPENDS_INDEX2 BTREE index on (PROVIDERID)

The following query returns the dependent object names and types and the provider names and types that they are dependent on:

SELECT dependentFinder.getSQLObjectName(dependentid)
    AS DEPENDENT_OBJECT_NAME,
DEPENDENTFINDER.getSQLObjectType() AS DEPENDENT_OBJECT_TYPE,
PROVIDERFINDER.getSQLObjectName(providerid)
    AS PROVIDER_OBJECT_NAME,
PROVIDERFINDER.getSQLObjectType() AS PROVIDER_OBJECT_TYPE
FROM SYS.SYSDEPENDS

The following query returns all of the providers on which a view (Segments_Seatbookings) is dependent:

SELECT PROVIDERFINDER.getSQLObjectName(providerid) AS
    PROVIDER_OBJECT_NAME,
PROVIDERFINDER.getSQLObjectType() as PROVIDER_OBJECT_TYPE
FROM SYS.SYSDEPENDS
WHERE dependentFinder.getSQLObjectName(dependentid) =
    'SEGMENTS_SEATBOOKINGS'

NOTE: Do not attempt to retrieve objects stored in the DEPENDENTFINDER and PROVIDERFINDER columns. Instead, call one of the documented methods on these columns as shown in the examples above.

Marking Dependent Stored Prepared Statements Invalid

Stored prepared statements are "dependents"; that is, they depend on other dictionary objects, which are their "providers." When a provider is changed or dropped, Cloudscape marks the stored prepared statement invalid, thus requiring recompilation at the next execution.

The invalidated target stored prepared statement is not recompiled until the next time the statement is executed.

Each time a statement is recompiled (either deliberately or as a side effect of some other action), the LASTCOMPILED field of SYS.SYSSTATEMENTS is updated with the timestamp at the time of recompilation.