home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / database / sybase / 283 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.5 KB  |  54 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!mcsun!julienas!genethon!stuart
  3. From: stuart@genethon.fr (Stuart Pook)
  4. Subject: insert of null into non-null field
  5. Message-ID: <1992Nov10.181730@genethon.fr>
  6. Originator: stuart@genethon.genethon.fr
  7. Sender: news@genethon.fr
  8. Nntp-Posting-Host: genethon.genethon.fr
  9. Organization: Genethon, Paris, France
  10. Date: Tue, 10 Nov 1992 17:17:30 GMT
  11. Lines: 41
  12.  
  13.  
  14. It turns out that it is possible, under Sybase 4.2 on a Sun, to insert
  15. NULL values into fields that are declared NOT NULL.  Has anybody else
  16. seen this problem?  Does this problem exist under 4.8, which we will
  17. install soon?  (I was expecting the substring to return an empty string
  18. forgetting that empty strings do not exist.)
  19.  
  20. Stuart
  21.  
  22. create table t(f varchar(20) not null)
  23. insert into t select substring("X", 2, 255)
  24. (1 row affected)
  25. insert into t values("F")
  26. (1 row affected)
  27. select f from t
  28.  f                    
  29.  -------------------- 
  30.  NULL                 
  31.  F                    
  32.  
  33. (2 rows affected)
  34. select f from t where f = f
  35.  f                    
  36.  -------------------- 
  37.  F                    
  38.  
  39. (1 row affected)
  40. select distinct f from t
  41. Msg 530, Level 16, State 1:
  42. Line 1:
  43. Attempt to insert NULL value into column 1 in work table (table id
  44. -81); column does not allow NULLS.  UPDATE fails.
  45.  f                    
  46.  -------------------- 
  47.  
  48. (1 row affected)
  49. select @@version
  50.                                                                    
  51.  ----------------------------------------------------------------- 
  52.  SQL Server/4.2/P/sun4/os4/EBF632/OPT/Tue Aug 27 11:58:42 PDT 1991 
  53.  
  54.