|The LIBNAME Statement for Relational Databases
a user-defined initialization command to execute immediately
after every connection to the DBMS that is within the scope of the LIBNAME
statement or libref.
||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
is any valid command that can be executed
by the SAS/ACCESS engine and that does
not return a result set or output parameters.
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,
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.
In the following example, the DBCONINIT= option causes
the DBMS to apply the SET statement to every connection that uses the MYDBLIB
libname mydblib db2
dbconinit="SET CURRENT SQLID='myauthid'";
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);
set amtbill = amtbill*1.10
where country = 'USA';
In the following example, a stored procedure is passed
libname mydblib oracle user=testuser pass=testpass
The SAS/ACCESS engine
retrieves the stored procedure and executes
DBCONTERM= LIBNAME Option
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.