13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The LIBNAME Statement <strong>for</strong> <strong>Relational</strong> <strong>Databases</strong> 4 DBCONTERM= LIBNAME Option 123Syntax DescriptionDBMS-user-commandis any valid command that can be executed by the <strong>SAS</strong>/<strong>ACCESS</strong> engine and thatdoes not return a result set or output parameters.DetailsThe termination command that you select can be a stored procedure or any DBMS SQLstatement that might provide additional control over the interaction between the<strong>SAS</strong>/<strong>ACCESS</strong> engine and the DBMS. The command executes immediately be<strong>for</strong>e <strong>SAS</strong>terminates each connection to the DBMS. If the command fails, then <strong>SAS</strong> provides awarning message but the library deassignment and disconnect still occur. You mustspecify the command as a single, quoted string.Note: The termination command might execute more than once, because oneLIBNAME statement might have multiple connections—<strong>for</strong> example, one <strong>for</strong> readingand one <strong>for</strong> updating. 4ExamplesIn the following example, the DBMS drops the Q1_SALES table be<strong>for</strong>e <strong>SAS</strong>disconnects from the DBMS.libname mydblib db2 user=testuser using=testpassdb=invoice bconterm=’drop table q1_sales’;In the following example, the stored procedure, SALESTAB_STORED_PROC, isexecuted each time <strong>SAS</strong> connects to the DBMS, and the BONUSES table is droppedwhen <strong>SAS</strong> terminates each connection.libname mydblib db2 user=testuserusing=testpass db=salesdbconinit=’exec salestab_stored_proc’dbconterm=’drop table bonuses’;See Also“DBCONINIT= LIBNAME Option” on page 121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!