Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ADD-SQL-DB-CATALOG-ENTRY

This statement adds an entry to the SQL database catalog.

Scope of validity

DBH administration

See also

Function

The ADD-SQL-DB-CATALOG-ENTRY statement adds an entry to the SQL database catalog.

You can only use this administration statement to add a new entry if there is a free entry in the SQL database catalog. If the SQL database catalog is full, the administration statement is rejected and an error message appears.

The database name you enter in the SQL database catalog must be unique; in other words, neither the logical nor the physical database name must already be entered in the SQL database catalog. This also applies to replications.

ADD-SQL-DB-CATALOG-ENTRY

CATALOG-NAME = <filename 1..18 without-cat-user-gen-vers>

,PHYS-CATALOG-NAME = *NONE / <filename 1..18 without-cat-user-gen-vers>

,USER-ID = *DBH-USER-ID / <name 1..8>

,PASSWORD = *NONE / <c-string 1..4> / <x-string 1..8> / <integer -2147483648..2147483647>

,ACCESS = *ALL / *PARAMETERS (...) / *COPY


*PARAMETERS (...)



|

READ = *YES / *NO



|

,WRITE = *YES / *NO



|

,CAT-ADMINISTRATION = *YES / *NO



|

,REPLICATION = *YES / *NO

,COPY-NUMBER = *NONE / <integer 1..999999>

Operands

CATALOG-NAME = <filename 1..18 without-cat-user-gen-vers>

Logical name of the database to be entered. The logical database name is the name by which a database is addressed in the application program. The logical database name must be unique; in other words, this name must not already be entered in the SQL database catalog. This also applies to replications.

PHYS-CATALOG-NAME = *NONE /  <filename 1..18 without-cat-user-gen-vers>
Physical name of the database to be entered.
The physical database name must be unique; in other words, this name must not already be entered in the SQL database catalog. This also applies to replications.

If you select *NONE, the default, for PHYS-CATALOG-NAME, SESAM/SQL forms the physical database name from the logical database name you assigned by means of CATALOG-NAME.

USER-ID = *DBH-USER-ID / <name 1..8>
DB user ID of the database.
The default for USER-ID is the DBH user ID.

PASSWORD = *NONE / <c-string 1..4> / <x-string 1..8> /  <integer -2147483648..2147483647>
BS2000 password that protects the files in the database from unauthorized access. If you select the default (*NONE), the DBH can only access the database when the BS2000 files in the database are not password protected.

ACCESS =
Defines which access functions are permitted with regard to the database.

ACCESS = *ALL
Allows unrestricted access to the database. Permits read and write access to user data and metadata.

ACCESS = *PARAMETERS (...)
Restricts access to the database.
The parameters are arranged in a hierarchical structure. If CAT-ADMINISTRATION is permitted, so, implicitly, are WRITE and READ In the same way, WRITE implicitly permits READ.

At least one parameter must be specified with *YES.

READ = *YES

Permits read access to user data and metadata. The data can be queried but not changed.

When READ=*YES (and also WRITE=*NO and CAT-ADMINISTRATION=*NO) is specified for a database, accesses to this database are accelerated by means of simplified transaction locks.

READ = *NO
Prevents read access to user data and metadata.
The database entered cannot be accessed until the lock is lifted by means of the MODIFY-CATALOG-ACCESS-RIGHTS administration statement.
It makes no sense to select READ = NO if you use the default (YES) for either CAT-ADMINISTRATION or WRITE, since CAT-ADMINISTRATION implicitly permits WRITE, and WRITE implicitly permits READ.

WRITE = *YES
Permits read and write access to user data. Metadata can be read but not changed. WRITE implicitly permits READ.

WRITE = *NO
Prevents write access to user data and metadata.
It makes no sense to select WRITE = NO if you assign the default (YES) to CAT-ADMINISTRATION, since CAT-ADMINISTRATION implicitly permits WRITE.

CAT-ADMINISTRATION = *YES
Permits read and write access to both user data and metadata. CAT-ADMINISTRATION implicitly permits WRITE and thus also READ.

CAT-ADMINISTRATION = *NO
Prevents write access to the metadata in the catalog space of the database. It therefore prevents the use of the following statements:

      • SQL statements for schema definition and management and memory management

      • Utility statements

REPLICATION = *YES
The database to be entered is a replication. Only read access and the REFRESH REPLICATION utility statement are permitted for a replication.

REPLICATION = *NO
The database to be entered is not a replication.

ACCESS = *COPY

After entry in the SQL-DB database catalog, only read access is permitted for this database (as with ACCESS = READ) in addition to the COPY utility statement. The other access functions are not permitted. As soon as COPY has been successfully executed, the parameter CAT-ADMINISTRATION=YES is set (i.e. read and write access is permitted for both user data and metadata).

If you want to enter the duplicate of a database in the SQL database catalog, you should select ACCESS=COPY. This prevents changes being made to the duplicate of the database before a SESAM backup copy has been created (see the “ Core manual”).

COPY-NUMBER = *NONE
The database to be entered is not a SESAM backup copy.

COPY-NUMBER = <integer 1..999999>
The SESAM backup copy of the catalog space with the specified number is added to the SQL database catalog. If the number of a SESAM backup copy was specified for the COPY-NUMBER operand, specification of ACCESS is not permitted. In this case, the access rights READ=YES, WRITE=NO and CAT-ADMIN=NO are set for ACCESS by default.


Administration command in ISP format and at the CALL DML interface

The OPT,DBC-INS administration command corresponds to the ADD-SQL-DB-CATALOG-ENTRY administration statement here.

OPT,DBC-INS,C[ATALOG]=catalog-name
          [,P[HYSICAL-NAME]=physical-name]
          [,U[SERID]=userid]
          [,P[ASS]W[ORD]=password]
          [,A[CCESS]=(access)]
          [,COPY-NR=copynr]
access ::= R[EAD],W[RITE],A[DMIN],C[OPY],REPL[ICATION]

catalog-name and physical-name must not contain any commas, since commas act as delimiters.

If access is not specified, the access functions READ, WRITE and ADMIN are permitted. If access was specified, specification of copyno is not permitted.

copyno contains the number of the SESAM backup copy of the catalog space. If copyno was specified:

  • the specified database must be a complete SESAM backup copy of a database, i.e. one created by means of COPY CATALOG

  • specification of access is not permitted. ACCESS is set to READ by default.

READ permits only read access, WRITE implicitly permits READ, and ADMIN implicitly permits WRITE and thus also READ.

The value REPLICATION means that this database is a replication. With this entry, only a replication can be accessed. Only read access and the REFRESH REPLICATION utility statement are permitted for a replication.

If you conclude the OPT,DBC-INS administration statement with a comma, the DBH expects more entries for it. To ensure that these are assigned correctly, you must enter the parameter CATALOG=catalog-name for them.

If you want the DBH to execute the administration command, you must not conclude it with a comma. If you conclude an administration command with a comma and follow it with another administration command, the DBH does not execute the first of the two commands, and an error message appears.