home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.sybase
- Path: sparky!uunet!tekbspa!tssgate!esh
- From: esh@prague.tss.com (Edward S. Hirgelt)
- Subject: Re: NULL to NOT NULL
- In-Reply-To: mharper@well.sf.ca.us's message of Tue, 15 Dec 1992 14:42:52 GMT
- Message-ID: <ESH.92Dec15103611@prague.tss.com>
- Sender: news@tss.com (USENET Network News)
- Organization: Teknekron Software Systems, Inc.
- References: <BzB27G.7Ex@well.sf.ca.us>
- Distribution: usa
- Date: Tue, 15 Dec 1992 18:36:11 GMT
- Lines: 27
-
-
- On Tue, 15 Dec 1992 14:42:52 GMT,
- mharper@well.sf.ca.us (Michael J. Harper) said:
- Michael> Sender: news@well.sf.ca.us
-
- Michael> If I create a column in a table which allows NULLs, is there a
- Michael> way to go back later and change this column to be NOT NULL?
-
- You can't change the definition of the table to prohibit nulls once
- you've defined it to permit them. You can, however, do one of two
- things:
-
- 1. Create a rule for the particular column that forbids nulls.
- 2. Modify the insert and update triggers (or create them) to check for
- nulls in this column. If it finds any it can roll back the
- transaction.
-
- The effect is the same after you install the rule or trigger. Inserts
- and updates will only succeed if the specific column is null.
-
- Rules are quite powerful little beasts...
-
- Ed
- --
- Ex vitio alterius |Ed Hirgelt |esh@tss.com
- sapiens emendat suum. |Teknekron Software Systems, Inc|
- (Publilius Syrus) |Palo Alto, Ca. |
-