A SERVICE OF

logo

The LIBNAME Statement for Relational Databases DBCONINIT= LIBNAME Option 85
DBMS support: DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle,
Microsoft SQL Server, SYBASE, Teradata
Default value:
none
Syntax
DBCONINIT=<’>DBMS-user-command<’>
Syntax Description
DBMS-user-command
is any valid command that can be executed by the SAS/ACCESS engine and that
does not return a result set or output parameters.
Details
The initialization command that you select can be a stored procedure or any DBMS
SQL statement that might provide additional control over the interaction between your
SAS/ACCESS interface and the DBMS.
The command executes immediately after each DBMS connection is successfully
established. If the command fails, then a disconnect occurs and the libref is not
assigned. You must specify the command as a single, quoted string.
Note: The initialization command might execute more than once, because one
LIBNAME statement might have multiple connections; for example, one for reading
and one for updating.
Examples
In the following example, the DBCONINIT= option causes the DBMS to apply the
SET statement to every connection that uses the MYDBLIB libref.
libname mydblib db2
dbconinit="SET CURRENT SQLID=’myauthid’";
proc sql;
select * from mydblib.customers;
insert into mydblib.customers
values(’33129804’, ’VA’, ’22809’, ’USA’,
’540/545-1400’, ’BENNETT SUPPLIES’, ’M. JONES’,
’2199 LAUREL ST’, ’ELKTON’, ’22APR97’d);
update mydblib.invoices
set amtbill = amtbill*1.10
where country = ’USA’;
quit;
In the following example, a stored procedure is passed to DBCONINIT=.
libname mydblib oracle user=testuser pass=testpass
dbconinit="exec dept_test(1001,25)";