Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> And another one about PL/SQL
Ok, I've tested it now - it worked !!!
SET lines 300
--
CREATE TABLE sites(sitecode VARCHAR2(6), category VARCHAR2(30)) Table created
ALTER TABLE sites ADD CONSTRAINT pk_sites PRIMARY KEY (sitecode) Table altered
INSERT INTO sites VALUES ('BRITPK','XXX') 1 row inserted
INSERT INTO sites VALUES ('OZPK','YYY')
1 row inserted
COMMIT
Commit complete
--
CREATE TABLE sitefeatures(blah INTEGER, sitecode VARCHAR2(6), category
VARCHAR2(30))
Table created
ALTER TABLE sitefeatures ADD CONSTRAINT pk_sitefeatures PRIMARY KEY
(blah)
Table altered
ALTER TABLE sitefeatures ADD CONSTRAINT ri_sites_sitefeatures FOREIGN KEY (sitecode) REFERENCES sites (sitecode) ON DELETE CASCADE Table altered
--
--
INSERT INTO sitefeatures (blah, sitecode) VALUES (2, 'OZPK') 1 row inserted
INSERT INTO sitefeatures (blah, sitecode, category) VALUES (3, 'BRITPK',
'THIS IS NOT THE DEFAULT')
1 row inserted
COMMIT
Commit complete
--
ORA-20001: SITECODE : BUMMER is unknown ORA-06512: at "SYSTEM.FEATURE_DETAILS", line 7 ORA-04088: error during execution of trigger 'SYSTEM.FEATURE_DETAILS'
--
SITECODE CATEGORY
-------- ------------------------------
BRITPK XXX OZPK YYY
SELECT * FROM sitefeatures
BLAH SITECODE CATEGORY
--------------------------------------- --------
------------------------------
1 BRITPK XXX 2 OZPK YYY 3 BRITPK THIS IS NOT THE DEFAULT
3 rows selected
Nice one Skippy !
Regards,
Norman.
Tel: 0113 289 6265 Fax: 0113 289 3146 URL: http://www.Lynx-FS.comReceived on Wed Jun 19 2002 - 06:27:02 CDT
-------------------------------------