CLOSE LINK

Closes links to a remote database.

SYNTAX

link_name Name of the link to a remote database you want to close.
remote_db_name Name of the remote database you want to close all links to.

DESCRIPTION

The CLOSE DATABASE LINK command closes links to a remote database. You can use this command to close a single link, or multiple links at the same time. Any user with an active link to a remote database can execute the CLOSE DATABASE LINK command.

A database link creates a connection to a remote database, providing access to remote data from your local database. Although you can directly identify remote databases, links provide additional benefits since they also contain security information. This allows you to connect to a remote database with a different user name than you are using in the local database, or connect to a remote database that you do not have an account in using a public link.

When you execute the CLOSE DATABASE LINK command and specify a link name, DBMaker will close that link to the remote database if the link is not being used by an active transaction. When you execute the CLOSE DATABASE LINK command and specify a remote database (the name of the database configuration section for the remote database in the local dmconfig.ini configuration file), DBMaker will close all links that connect to the remote database. In either case, if a link is being used by an active transaction, the link will remain open and DBMaker will return an error. To close this link, you must wait until the transaction is finished and try closing the link again.

The NONACTIVE keyword closes all links to a remote database that are not being used by an active transaction. If a transaction is using a link when you execute the CLOSE DATABASE LINK command using the NONACTIVE keyword, the link will remain open. To close this link, you must wait until the transaction is finished and try closing the link again.

The ALL keyword closes all links to a remote database. If a transaction is using a link when you execute the CLOSE DATABASE LINK command using the ALL keyword, the link will remain open and DBMaker will return an error. To close this link, you must wait until the transaction is finished and try closing the link again.

EXAMPLES

The following example closes the link named FieldLink.

CLOSE DATABASE LINK FieldLink

The following example closes all links to the remote database identified in the local dmconfig.ini configuration file as FieldOffice.

CLOSE DATABASE LINK FieldOffice

The following example closes all links to all remote databases that are not being used by an active transaction.

CLOSE DATABASE LINK NONACTIVE

The following example closes all links to all remote databases. If a link in being used by an active transaction, DBMaker will return an error for that link and the link will remain open.

CLOSE DATABASE LINK ALL

RELATED COMMANDS

< CHECKPOINT | Contents | COMMIT WORK >

Copyright 2002 SYSCOM Computer Engineering Co. All rights reserved.