Chapter Contents

Previous

Next
DBNULL=

DBNULL=



Indicates whether NULL is a valid value for the specified columns when a table is created.

Default value: DBMS specific
See Also: NULLCHAR=, NULLCHARVAL=


Syntax
Details

Syntax

DBNULL=(_ALL_=YES | NO) | (<column-name-1=YES | NO> <... <column-name-n=YES | NO>>)

column-name
is a DBMS column in the table that is being created.

YES
indicates that a NULL value is valid for the specified columns in the DBMS table.

NO
indicates that a NULL value is not valid for the specified columns in the DBMS table.

_ALL_
indicates that the YES or NO value applies to all columns in the table.


Details

This option is valid only for creating DBMS tables.

If you specify more than one column name, the names must be separated with spaces.

In the following example, the EMPID and JOBCODE columns in the new MYDBLIB.MYDEPT2 table are prevented from accepting null values by using the DBNULL= option. Any subsequent attempt to insert NULL values into these columns will fail.

data mydblib.mydept2(dbnull=(empid=no jobcode=no));
   set mydblib.employees;
run; 

In the next example, all columns in the new MYDBLIB.MYDEPT3 table, except for the JOBCODE column, are prevented from accepting null values.

data mydblib.mydept3(dbnull=(_ALL_=no jobcode=YES));
   set mydblib.employees;
run; 
Note that the DBNULL= option processes values from left to right, so if you specify a column name twice, or if you use the _ALL_ value, the last value overrides the first value specified for the column.

See your DBMS chapter for details on the option values that are supported by your DBMS.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.