close

Log off from the specified path or from all paths.

close {"PathName/net"}

Example: close "$MY_PATH"

Qualifiers

Qualifiers
Qualifier Description
/net Specifies that PathName is a TCP or TLS network path, and is treated as part of the PathName. If the path was opened using /net, it must also closed using /net.

For the following path names, /net is implicit and does not have to be supplied: $DNP, $TCP, and $TLS.

Any path not recognized as a network path is assumed to be a DBMS path.

Parameters

Parameters
Parameter Data Type Description
PathName

String

Name of a DBMS or network path, such as $MSS. $DATA, or $TCP. The leading dollar sign ($) is required.
  • If PathName is omitted, close closes all DBMS paths and all network paths, including paths to remote components.
  • If PathName is a local or remote DBMS path, close closes all open tables and files for all the entities on PathName, and logs off from the database. For a remote DBMS path this is all that happens; the network connection is not closed because /net is not used.
  • If PathName is a network path to a Uniface File Server, close closes all the entities on PathName, logs off from the databases accessed using PathName. If /net is used, it also closes the network connection.
  • If PathName is a network path to a Uniface Application Server, close closes all remote component instances on the path and stops the synchronous Uniface Server, if applicable. If it is an exclusive Uniface Server, it closes it.

    If /net is used, it also closes the network connection.

 

Return Values

Values returned in $status
Value Meaning
0 The path was successfully closed.
-3 Exceptional I/O error (hardware or software).
-16 Network error: unknown.
Values commonly returned by $procerror following close
Value Error constant Meaning
-2 through -12 <UIOSERR_*> Errors during database I/O.
-16 through -30 <UNETERR_*> Errors during network I/O.
-1107 <UPROCERR_PATH> The path name is not correct or the path does not exist, for example, no assignment is found for the path, or the path was opened with /net but not closed with /net.

Use

Allowed in all component types.

Description

When you close a path that leads to DBMS tables or files, it is recommended that a commit or rollback be performed before the close. In this way, the application does not rely on the behavior of the DBMS and behaves consistently.

The following example shows the use of the close statement to log off from all DBMSs:

; trigger: Detail

if ($status = 1)
    rollback
    close
    apexit
endif

The following statement closes the database identified by path $MMS:

close "$MSS"

The following statement closes the user-defined path $MY_PATH:

close "$MY_PATH"

Related Topics