Technical data

DB (Subschema Description)
DB (Subschema Description)
Function
The Subschema entry allows a program to access a subschema in Oracle
CDD/Repository under the schema name.
General Format
DB sub-schema-name WITHIN schema-name
FOR database-name
THRU
THROUGH
stream-name
.
sub-schema-name
references a subschema name in Oracle CDD/Repository under the schema name.
See Technical Notes for more information.
schema-name
references a schema name in Oracle CDD/Repository. See Technical Notes for
more information.
database-name
represents a complete or partial file specification defining the database
occurrence. A database occurrence is a root file. At run time, database-name
points the Database Control System (DBCS) to the root file. See Technical Notes
for more information.
stream-name
represents the name of the stream. See Technical Notes for more information.
General Rules
1. The compiler finds the schema-name within Oracle CDD/Repository under
your CDD$DEFAULT and includes these sub-schema-name definitions
in your program: realm names, set names, record names, database data-
names. These definitions are user-defined words. Other definitions include
the database registers DB-CONDITION, DB-CURRENT-RECORD-NAME,
DB-UWA, DB-CURRENT-RECORD-ID, and DB-KEY. Subschema definitions
are also called database objects.
2. Database objects implicitly have the global attribute. Therefore, any program
contained within a program declaring the DB statement can access any of the
declaring program’s database objects.
3. Only one DB statement is allowed for each separately compiled program;
however, more than one DB statement is allowed in the run unit if its
separately compiled programs define identical DB statements, or if each
separately compiled program uses a stream.
4. Database objects either explicitly or implicitly defined in the subschema
section are external objects by default. However, these objects can only be
referenced by a program defining the DB statement or a program contained
within that program.
Data Division 3–5