Creates a temporary database object that specifies a relational
database (Format 1) or a Oracle CODASYL DBMS database instance
(Format 2).
Format 1
DECLARE DATABASE rdb-database-name ON root-file-spec;
Format 2
DECLARE DATABASE dbms-database-name
[USING] [SUBSCHEMA] subschema-name
[OF] [SCHEMA] schema-path-name
ON root-file-spec;
1 – Arguments
rdb-database-name
Is the name of the relational database you want to declare.
It must be a simple name.
root-file-spec
Is the name of the database root file. For relational databases,
the default file type is .RDB; for Oracle CODASYL DBMS, the
default file type is .ROO. A complete file specification has
the following format:
node-spec::device:[directory]file-name.type;version
dbms-database-name
Is the name you choose for the Oracle CODASYL DBMS database
instance.
It must be a simple name.
subschema-name
Is the name of a subschema for the specified schema.
schema-path-name
Is the dictionary path name of a Oracle CODASYL DBMS schema.
;(semicolon)
Ends the DECLARE DATABASE command.
2 – Examples
Declare a relational database object:
DTR> DECLARE DATABASE MY_DB ON DTR$LIBRARY:PERSONNEL.RDB ;
DTR>
Declare a Oracle CODASYL DBMS database instance. The Oracle
CDD/Repository path name of the schema is
CDD$COMPATIBILITY.DTR$LIB.DEMO.DBMS.PARTS.
The name of the subschema is DTR_SUBSCHEMA,
and the root file is DTR$LIBRARY:DTRPARTDB.ROO:
DTR> DECLARE DATABASE MY_PARTS_DB USING SUBSCHEMA DTR_SUBSCHEMA
DFN> OF SCHEMA CDD$COMPATIBILITY.DTR$LIB.DEMO.DBMS.PARTS
DFN> ON DTR$LIBRARY:DTRPARTDB.ROO ;