Previous Page | Next Page

The LIBNAME Statement for Relational Databases

DBLIBTERM= LIBNAME Option



Specifies a user-defined termination command to execute once, before the DBMS that is associated with the first connection made by the LIBNAME statement or libref disconnects.
Default value: none
Valid in: SAS/ACCESS LIBNAME statement
DBMS support: Aster nCluster, DB2 under UNIX and PC Hosts, DB2 under z/OS, Greenplum, HP Neoview, Informix, Microsoft SQL Server, MySQL, Netezza, ODBC, OLE DB, Oracle, Sybase, Sybase IQ, Teradata

Syntax
Syntax Description
Details
Example
See Also

Syntax

DBLIBTERM=<'>DBMS-user-command<'>

Syntax Description

DBMS-user-command

is any DBMS command that can be executed by the SAS/ACCESS engine and that does not return a result set or output parameters.


Details

The termination command that you select can be a script, stored procedure, or any DBMS SQL statement that might provide additional control over the interaction between the SAS/ACCESS engine and the DBMS. The command executes immediately before SAS terminates the last connection to the DBMS. If the command fails, then SAS provides a warning message but the library deassignment and disconnect still occurs. You must specify the command as a single, quoted string.

DBLIBTERM= fails if either CONNECTION=UNIQUE or DEFER=YES or both of these LIBNAME options are specified.

When two LIBNAME statements share the same physical connection, the termination command is executed only once. (Multiple LIBNAME statements that use CONNECTION=GLOBALREAD and identical values for CONNECTION_GROUP=, DBCONINIT=, DBCONTERM=, DBLIBINIT=, and DBLIBTERM= options and any DBMS connection options can share the same connection to the DBMS.)


Example

In the following example, CONNECTION=GLOBALREAD is specified on both LIBNAME statements, but the DBLIBTERM commands are different. Therefore, the second LIBNAME statement fails to share the same physical connection.

libname mydblib oracle user=testuser pass=testpass 
   connection=globalread dblibterm='Test';

libname mydblib2 oracle user=testuser pass=testpass
   connection=globalread dblibterm='NoTest';


See Also

CONNECTION= LIBNAME Option

DBLIBINIT= LIBNAME Option

DEFER= LIBNAME Option

Previous Page | Next Page | Top of Page