0
我想在包含两个表的列的视图中插入一些数据。 的问题是,我收到了错误:如何插入连接视图?
SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table
这是我的代码:
CREATE VIEW testvizualizare AS
SELECT
F.id_formatie, F.nume nume_formatie, F.data_lansare, F.tara_prov,
A.data_l, A.gen, A.id_album, A.id_formatie id_formatie_album, A.nume nume_album, A.pret
FROM
formatie F JOIN album A ON(F.id_formatie = A.id_formatie)
JOIN castiga C ON (C.id_formatie = A.id_formatie)
JOIN premiu P ON(P.id_premiu = C.id_premiu)
WHERE
EXISTS(
SELECT
1
FROM
formatie F1 JOIN album A1 ON(F1.id_formatie = A1.id_formatie)
JOIN castiga C1 ON (C1.id_formatie = A1.id_formatie)
JOIN premiu P1 ON(P1.id_premiu = C1.id_premiu)
WHERE
f1.id_formatie = F.id_formatie AND LOWER(a1.gen) = 'pop');
INSERT INTO testvizualizare
VALUES(100, 'Atmosphere', (SELECT TO_DATE('01011996', 'DDMMYYYY') FROM DUAL), 'USA', (SELECT TO_DATE('06052014', 'DDMMYYYY') FROM DUAL), 'Hip-Hop', 999, 100, 'Southsiders', 15);
我想这个问题是加盟。我为每个表格创建两个插入(F和A)。我也尝试删除A.id_formatie
,但没有运气。
任何帮助appreaciated!谢谢。
http://stackoverflow.com/a/1653192/575376 –