DBLIBINIT= LIBNAME Statement Option

Specifies a valid data source command to be executed once within the scope of the LIBNAME statement or libref that established the first connection to the data source.

Valid in: LIBNAME statement
Default: none
Supports: All

Syntax

DBLIBINIT=<'> command<'>

Syntax Description

command

is any SQL or SAS FedSQL language statement, DBMS script, stored procedure, or native DBMS command that is supported by the driver. The command must not return a result set.

Details

The initialization command that you select can be a script, stored procedure, or any SAS FedSQL language or DBMS SQL statement that might provide additional control over the interaction between the LIBNAME engine and the data source.
The command executes immediately after the first connection is successfully established. If the command fails, a disconnect occurs and the libref is not assigned. You must specify the command as a single, quoted string, unless it is an environment variable.
DBLIBINIT= fails if either CONNECTION=UNIQUE or DEFER=YES, or if both of these LIBNAME statement options are specified.

Example: Specifying an Initialization Command for All Operations in a Libref

libname mydblib fedsvr server="d1234.us.company.com" 
   port=2171 user=user1 pwd=pass1
   dsn=oradsn connection=shared dblibinit='Test';