Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Examples

RDB/VMS SQL SET_SCHEMA — VMS RDB_4.1A

 SET SCHEMA ---+-> schema-string-literal ----+-> ;
               +-> schema-parameter ---------+
               +-> schema-parameter-marker --+

 SET SCHEMA specifies the default schema for a user session.

Additional information available:

Examples

Examples

 Example 1:  Setting schema and catalog defaults to create a
 table in a multischema database.

 The following example shows a session attached to two databases:
 the default database, PERSONNEL, and the multischema
 CORPORATE_DATA database, with alias CORP.  A SET SCHEMA
 statement changes the defaults to catalog ADMINISTRATION and
 schema ACCOUNTING of the CORPORATE_DATA database,

 The alias and catalog name are combined in a delimited
 identifier, which requires double quotation marks.  Because the
 default alias specifies the PERSONNEL database, the SHOW
 statement shows the fully qualified names of objects in the
 CORPORATE_DATA database.

 SQL> ATTACH 'FILENAME PERSONNEL';
 SQL> ATTACH 'ALIAS CORP FILENAME CORPORATE_DATA';
 SQL>  SHOW DATABASES;
 Default alias:
     Rdb/VMS database in file PERSONNEL
 Alias CORP:
     Rdb/VMS database in file CORPORATE_DATA
 SQL>  SHOW SCHEMAS;
 Schemas in database with filename PERSONNEL
 No schemas found
 Schemas in database CORP
     "CORP.ADMINISTRATION".ACCOUNTING
     "CORP.ADMINISTRATION".PERSONNEL
     "CORP.ADMINISTRATION".RECRUITING
     "CORP.RDB$CATALOG".RDB$SCHEMA
 SQL> SET ANSI QUOTING ON;
 SQL> SET SCHEMA '"CORP.ADMINISTRATION".ACCOUNTING';
 SQL>  CREATE TABLE BUDGET (COL1 REAL);
 SQL>  SHOW TABLES;
 User tables in database with filename personnel
      CANDIDATES
      COLLEGES
           .
           .
           .
      User tables in database with alias CORP
      "CORP.ADMINISTRATION".ACCOUNTING.BUDGET
           .
           .
           .

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026