home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.sybase
- Path: sparky!uunet!mcsun!julienas!genethon!stuart
- From: stuart@genethon.fr (Stuart Pook)
- Subject: insert of null into non-null field
- Message-ID: <1992Nov10.181730@genethon.fr>
- Originator: stuart@genethon.genethon.fr
- Sender: news@genethon.fr
- Nntp-Posting-Host: genethon.genethon.fr
- Organization: Genethon, Paris, France
- Date: Tue, 10 Nov 1992 17:17:30 GMT
- Lines: 41
-
-
- It turns out that it is possible, under Sybase 4.2 on a Sun, to insert
- NULL values into fields that are declared NOT NULL. Has anybody else
- seen this problem? Does this problem exist under 4.8, which we will
- install soon? (I was expecting the substring to return an empty string
- forgetting that empty strings do not exist.)
-
- Stuart
-
- create table t(f varchar(20) not null)
- insert into t select substring("X", 2, 255)
- (1 row affected)
- insert into t values("F")
- (1 row affected)
- select f from t
- f
- --------------------
- NULL
- F
-
- (2 rows affected)
- select f from t where f = f
- f
- --------------------
- F
-
- (1 row affected)
- select distinct f from t
- Msg 530, Level 16, State 1:
- Line 1:
- Attempt to insert NULL value into column 1 in work table (table id
- -81); column does not allow NULLS. UPDATE fails.
- f
- --------------------
-
- (1 row affected)
- select @@version
-
- -----------------------------------------------------------------
- SQL Server/4.2/P/sun4/os4/EBF632/OPT/Tue Aug 27 11:58:42 PDT 1991
-
-