1
UPDATE ta_1 SET v_1 = 'new value' WHERE v_1 = 'value';
UPDATE ta_1 SET v_1 = 'newest value';
首先更新查詢後返回異常ORA-12899和第二並不時在此表中執行:ORA-12899對象表更新
CREATE OR REPLACE type t_2 AS object
(v_1 VARCHAR2 (4000));
CREATE OR REPLACE type t_1 AS object
(
v_1 VARCHAR2 (4000),
v_2 t_2);
CREATE TABLE ta_1 OF t_1
(CHECK (v_2 IS NULL OR (v_2.v_1 = 'uFonec')) ENABLE
) ;
CREATE OR REPLACE TRIGGER ta_1_tr BEFORE
INSERT OR
UPDATE ON ta_1 FOR EACH ROW DECLARE BEGIN IF :new.v_2 IS NULL THEN :new.v_2 := NEW t_2 ('uFonec') ;
END IF;
END;
INSERT INTO ta_1 VALUES (t_1 ('value', NULL)) ;
首先更新查詢返回:
SQL Error: ORA-12899: value too large for column "TA_1"."V_2" (actual: 1, maximum: 0)
在表上禁用約束條件時,兩個更新查詢都有效。在Oracle-XE 10g2上測試。這是一個錯誤還是在某些Oracle手冊中寫入它是一個功能?