/* Constraint */
-- Constraint is an object of a database
-- NOT NULL, UNIQUE, PRIAMARY KEY, FOREIGN KEY, etc...
/* NOT NULL */
CREATE TABLE ex2_6(
col_null VARCHAR2(10),
col_not_null VARCHAR2(10) NOT NULL
);
INSERT INTO ex2_6
VALUES
('AA', '') -- ''generates ERROR
;
INSERT INTO ex2_6
VALUES
('AA', 'BB')
;
/* Auto-identified Constraint by Oracle */
SELECT
constraint_name, -- SYS_C... (auto-identified)
constraint_type, -- C (Constraint)
table_name,
search_condition
FROM user_constraints -- System view
WHERE table_name = 'EX2_6'
;