SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)

Converting an SQL/MP Database to SQL/MX Tables
HP NonStop SQL/MX Database and Application Migration Guide540435-005
11-6
User Catalogs and Schemas
User Catalogs and Schemas
An SQL/MP catalog is a set of tables and indexes that describe SQL/MP database
objects. Tables in the set are called catalog tables, and NonStop SQL/MP creates them
and their indexes when you execute a CREATE CATALOG statement. Each SQL/MP
catalog (the set of catalog tables and their indexes) resides on its own Guardian
subvolume, and the name of that subvolume is also the name of the catalog. NonStop
SQL/MP allows you to create and drop catalogs. For more information, see the
SQL/MP Reference Manual.
An SQL/MX user catalog is a named logical object that contains descriptions of a set of
schemas. A user catalog can contain multiple schemas, each possibly owned by a
different user. A catalog cannot contain other catalogs. To access SQL/MX database
objects, use the three-part name (
catalog.schema.object) of the actual database
object.
NonStop SQL/MX uses ANSI-compliant CREATE and DROP statements to create and
drop schemas. Any user on a node can create a catalog on that node and can drop an
empty catalog on that node. For more information, see the
SQL/MX Reference Manual.
Database Object Names
SQL/MP data is stored in files with Guardian physical names. You specify Guardian
physical names when creating SQL/MP database objects. In SQL/MP applications, you
refer to SQL/MP database objects by their Guardian physical names or by DEFINE
names that map to the Guardian physical names.
In SQL/MX applications, you refer to SQL/MP database objects by their Guardian
physical names or by DEFINE names or SQL/MP aliases that map to the Guardian
physical names. SQL/MP aliases are three-part logical names of the form
catalog.schema.object that map to Guardian physical names. In SQL/MX
Release 2.x,
catalog in an SQL/MP alias refers to an existing SQL/MX user catalog,
and
schema in an SQL/MP alias refers to an existing SQL/MX user schema.
SQL/MX data is stored in files with Guardian physical names, but the files are
associated with external ANSI names. The ANSI name is a three-part logical name
consisting of the catalog, schema, and object name:
catalog.schema.object
You must use ANSI names when creating or referring to SQL/MX database objects.
You cannot use DEFINE names for SQL/MX database objects. To refer to SQL/MX
database objects, use unqualified or partially qualified names (that is, without catalog
or schema names), or use PROTOTYPE host variables. However, PROTOTYPE host
variables require you to include database object naming in the application logic. For
more information about database object names, see the
SQL/MX Reference Manual.
For more information about PROTOTYPE host variables, see the
SQL/MX
Programming Manual for C and COBOL.
The namespace for SQL/MX database objects is organized in hierarchically. Database
objects exist in schemas, which are themselves contained in catalogs. Catalogs are