home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / database / sybase / 565 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  1.4 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!ucbvax!mtxinu!sybase!robert
  2. From: robert@sybase.com (Robert Garvey)
  3. Newsgroups: comp.databases.sybase
  4. Subject: Re: NULL to NOT NULL
  5. Keywords: nulls, rules, triggers
  6. Message-ID: <27422@sybase.sybase.com>
  7. Date: 22 Dec 92 17:29:34 GMT
  8. References: <BzB27G.7Ex@well.sf.ca.us> <ESH.92Dec15103611@prague.tss.com>
  9. Sender: news@Sybase.COM
  10. Distribution: usa
  11. Organization: Emeryville Tupleware, Party Planning Division
  12. Lines: 23
  13.  
  14. In article <ESH.92Dec15103611@prague.tss.com>, esh@prague.tss.com (Edward S. Hirgelt) writes:
  15. |>
  16. |> 1. Create a rule for the particular column that forbids nulls.
  17.  
  18.     Null values are not checked against a rule of the column allows
  19.     nulls, so this won't work as expected.
  20.  
  21. |> 2. Modify the insert and update triggers (or create them) to check for
  22. |>    nulls in this column. If it finds any it can roll back the
  23. |>    transaction.
  24.  
  25.     This will work.
  26.  
  27. Warren Finnerty's recommendation to put the data into another table with
  28. a different schema, one that has that column disallowing nulls, may be a
  29. better way to go, provided you don't have any rows with null in them.
  30. It would also be prudent to heed Warren's caution about dependencies.
  31.  
  32. -- 
  33. Robert Garvey robert@sybase.com {sun,lll-tis,pyramid,pacbell}!sybase!robert
  34.           Sybase, Inc   6475 Christie Ave   Emeryville, CA   94608-1010
  35.  
  36. Opinions here may be attributed to the poster and are not related to Sybase.
  37.