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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The LIBNAME Statement <strong>for</strong> <strong>Relational</strong> <strong>Databases</strong> 4 DBNULLKEYS= LIBNAME Option 133DBNULLKEYS= LIBNAME OptionControls the <strong>for</strong>mat of the WHERE clause when you use the DBKEY= data set option.Default value:Valid in:DBMS-specific<strong>SAS</strong>/<strong>ACCESS</strong> LIBNAME statementDBMS support: Aster nCluster, DB2 under UNIX and PC Hosts, DB2 under z/OS,Greenplum, HP Neoview, In<strong>for</strong>mix, Microsoft SQL Server, Netezza, ODBC, OLE DB,Oracle, Sybase IQSyntaxDBNULLKEYS=YES | NODetailsIf there might be NULL values in the transaction table or the master table <strong>for</strong> thecolumns that you specify in the DBKEY= data set option, use DBNULLKEYS=YES.This is the default <strong>for</strong> most interfaces. When you specify DBNULLKEYS=YES andspecify a column that is not defined as NOT NULL in the DBKEY= data set option,<strong>SAS</strong> generates a WHERE clause that can find NULL values. For example, if youspecify DBKEY=COLUMN and COLUMN is not defined as NOT NULL, <strong>SAS</strong> generatesa WHERE clause with the following syntax:WHERE ((COLUMN = ?) OR ((COLUMN IS NULL) AND (? IS NULL)))This syntax enables <strong>SAS</strong> to prepare the statement once and use it <strong>for</strong> any value(NULL or NOT NULL) in the column. Note that this syntax has the potential to bemuch less efficient than the shorter <strong>for</strong>m of the following WHERE clause. When youspecify DBNULLKEYS=NO or specify a column that the DBKEY= option defines asNOT NULL, <strong>SAS</strong> generates a simple WHERE clause.If you know that there are no NULL values in the transaction table or the mastertable <strong>for</strong> the columns that you specify in the DBKEY= option, then you can useDBNULLKEYS=NO. This is the default <strong>for</strong> the interface to In<strong>for</strong>mix. If you specifyDBNULLKEYS=NO and specify DBKEY=COLUMN, <strong>SAS</strong> generates a shorter <strong>for</strong>m ofthe WHERE clause, regardless of whether the column specified in DBKEY= is definedas NOT NULL:WHERE (COLUMN = ?)See AlsoTo apply this option to an individual data set, see the “DBNULLKEYS= Data SetOption” on page 311.“DBKEY= Data Set Option” on page 305

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

Saved successfully!

Ooh no, something went wrong!