4. Maintaining a Distributed Database : Register as Link Statement--Define Database Objects to Ingres Star
 
Share this page                  
Register as Link Statement--Define Database Objects to Ingres Star
The register as link statement defines a distributed database component name to Ingres Star as an alias of a local or remote table or view. The statement is stored in the iiregistrations catalog.
Use the register as link statement to define to Ingres Star:
Data resident in an Ingres local database
Database procedures resident in an Ingres local database or accessible through Enterprise Access
Data accessed by means of Enterprise Access
Note:  To register non-SQL data, you first must identify the data to the non-SQL Enterprise Access with the register as import statement. For information on how to use this statement, see the guide for your specific Enterprise Access.
The register as link statement has the following format:
register object_type object_name
       [(col_name {, col_name})]
       as link
       [from [local_owner_name.]local_object_name]
              [with
                     [node = node_name,
                     database = database_name]
                     [, dbms = server_class]]
object_type
Can be table, view or database procedure. For tables or views, the object_type is optional. However, to register a database procedure, the keyword procedure must be specified.
object_name
Is the Ingres Star name of the local DBMS table, view, or database procedure you are registering. It can be delimited with double quotes.
col_name
Is the Ingres Star name of the corresponding column in the local DBMS table or view. (Do not use when registering procedures.) It can be delimited with double quotes.
There can be as many column names as Ingres Star allows in a table or view. This column name is the one used in queries presented to Ingres Star. All column names must follow the Ingres naming conventions.
This column name must be specified in the order corresponding to its location in the underlying local DBMS table or view (the nth Ingres Star column name corresponds to the nth local column name.)
All columns must be named. If column names are not specified, Ingres Star uses the column names obtained from the local DBMS standard catalogs for the table or view specified.
as link
Indicates that the register statement will create an Ingres Star registration linked to a table, view, or database procedure in a local database. This clause must be specified.
from
Specifies the owner and name of the local table, view, or database procedure you are registering. You must use this clause if you are registering an object in your distributed database with a different name from its name in the local database, or the object name does not follow Ingres naming conventions, is case sensitive, or is owned by another user.
local_object_name
Is the name of the table, view, or database procedure in the local database.
It can be delimited with double quotes to preserve case and allow special characters. However, if the Ingres Star database does not support mixed-case delimited identifiers and the local DBMS or Enterprise Access product does support mixed-case delimited identifiers, you should use a single-quote delimiter in order for Ingres Star to preserve the case.
local_owner_name
Is the name of the owner of the object in the local database. You can register other user's tables, views, and database procedures, but you must specify the owner name. If you do not specify an owner name, local_owner_name defaults first to an object owned by the current user, second to an object owned by the DBA, and third to an object owned by $ingres.
It can be delimited with double quotes to preserve case and allow special characters. However, if the Ingres Star database does not support mixed-case delimited identifiers and the local DBMS or Enterprise Access product does support mixed-case delimited identifiers, you should use a single-quote delimiter for Ingres Star to preserve the case.
Do not forget to include the period at the end of the owner name.
with
Provides additional information about the local database table, view, or database procedure being registered and its location in relation to Ingres Star.
node = node_name
Is the Net vnode name (the virtual node name) that holds the object you are registering. The default is the node that contains the Star Server processing the command. The node_name can be up to 32 bytes long. It can be delimited with double quotes.
If you specify the node = clause, you also must specify the database = clause.
database = database_name
Specifies the name of the local database that contains the object you are registering. It can be delimited with double quotes.
The database name can be up to 256 bytes long provided it is specified in quotes.
If you specify the database = clause, you must specify the node = clause. If the database is omitted, the coordinator database is the default.
dbms = server_class
Specifies the type of local DBMS that contains the object being registered.
The server_class must be Ingres or one of the SQL Enterprise Access products. If you do not specify a server class the default is the value in default_server_class on the remote installation (Ingres, unless defined otherwise.) Use the Configure Name Server screen of the CBF or Visual CBF utilities to view or change this value.