NOT NULL constraints are missing from a table script in some cases.
说明
To reproduce the issue run the script below:
CREATE OR REPLACE TYPE notification_typ AS OBJECT ( ID INTEGER, CUSTOMER_ID INTEGER, -- NOT NULL, SUBJECT VARCHAR2 (4000 BYTE), -- NOT NULL, MAIL_OPEN_ID INTEGER, -- NOT NULL, DATE_OPEN DATE, -- NOT NULL, MAIL_CLOSE_ID INTEGER, DATE_CLOSE DATE, STATUS INTEGER, -- DEFAULT 1 NOT NULL, COMMENT$ VARCHAR2 (1000 CHAR) );
CREATE TABLE t_test ( EZPT TIMESTAMP (3) WITH TIME ZONE DEFAULT SYSTIMESTAMP NOT NULL, CREATOR VARCHAR2 (30 BYTE) DEFAULT USER NOT NULL, AEZPT TIMESTAMP (3) WITH TIME ZONE DEFAULT NULL, CHANGER VARCHAR2 (30 BYTE), notification notification_typ -- check(notification.customer_id is NOT NULL) );
ALTER TABLE t_test ADD CHECK (notification.customer_id IS NOT NULL);
ALTER TABLE t_test ADD CHECK (notification.subject IS NOT NULL);
ALTER TABLE t_test ADD CHECK (notification.mail_open_id IS NOT NULL);
ALTER TABLE t_test ADD CHECK (notification.date_open IS NOT NULL);
ALTER TABLE t_test ADD CHECK (notification.status IS NOT NULL);
-- -- PK_NOTIFICATIONS#ID (Index) -- CREATE UNIQUE INDEX pk_test#id ON t_test (notification.id) LOGGING PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT );
ALTER TABLE t_test ADD ( CONSTRAINT pk_test#id PRIMARY KEY (notification.id) USING INDEX pk_test#id ENABLE VALIDATE);
Then go to Schema Browser and check for the script for table t_test . The script does not contain the not null constraints.
解决办法
WORKAROUND
None
STATUS
Issue fixed in version 12.8. The latest version of Toad For Oracle can be downloaded at: https://support.quest.com/toad-for-oracle/download-new-releases