Hi,
I got a bit of a problem with this one. Below is a small sample of the replicated problem (because the real tables have many more columns).
Do you guys know a way round this ? ?
Thanks,
Rich.
Programmers are tools for converting caffeine into code
I got a bit of a problem with this one. Below is a small sample of the replicated problem (because the real tables have many more columns).
Code:
CREATE TABLE abc
(
IDENT VARCHAR2(100) NOT NULL PRIMARY KEY,
CREATION DATE DEFAULT SYSDATE NOT NULL
);
/
CREATE OR REPLACE VIEW abc_v (IDENT, CREATION) AS
SELECT SUBSTR(IDENT, 1, 3), CREATION
FROM abc;
/
CREATE OR REPLACE TRIGGER abc_v_b4
INSTEAD OF INSERT ON abc_v
FOR EACH ROW
DECLARE
BEGIN
INSERT INTO abc (IDENT, CREATION) VALUES ( :new.IDENT, :new.CREATION);
END;
/
-- succeeds
INSERT INTO abc (IDENT) VALUES ( 'ABC' );
-- fails
INSERT INTO abc_v (IDENT) VALUES ( 'ABC' );
Do you guys know a way round this ? ?
Thanks,
Rich.
Programmers are tools for converting caffeine into code