home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / sybase / 497 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.4 KB  |  41 lines

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