Allowing null values in a column  Defaults and null values

Chapter 8: Creating Databases and Tables

Constraints and rules used with null values

You cannot define a column to allow null values, and then override this definition with a constraint or a rule that prohibits null values. For example, if a column definition specifies NULL and a rule specifies:

@val in (1,2,3)

An implicit or explicit NULL does not violate the rule. The column definition overrides the rule, even a rule that specifies:

@val is not null

See “Defining integrity constraints for tables” for more information on constraints. Rules are covered in detail in Chapter 13, “Defining Defaults and Rules for Data.”





Copyright © 2005. Sybase Inc. All rights reserved. Defaults and null values

View this book as PDF