Revision 93
Added by bojilova over 24 years ago
src/xmltables.sql | ||
---|---|---|
21 | 21 |
|
22 | 22 |
DROP TRIGGER xml_nodes_before_insert; |
23 | 23 |
DROP TRIGGER xml_documents_before_insert; |
24 |
DROP TRIGGER xml_cat_entities_before_insert;
|
|
24 |
DROP TRIGGER xml_catalog_before_insert;
|
|
25 | 25 |
|
26 |
DROP TABLE xml_catalog_entities; |
|
27 | 26 |
DROP TABLE xml_catalog; |
28 | 27 |
DROP TABLE xml_documents; |
29 | 28 |
DROP TABLE xml_nodes; |
... | ... | |
83 | 82 |
/ |
84 | 83 |
|
85 | 84 |
/* |
86 |
* XML Catalog -- tables to store all external sources for XML documents
|
|
85 |
* XML Catalog -- table to store all external sources for XML documents |
|
87 | 86 |
*/ |
88 | 87 |
CREATE TABLE xml_catalog ( |
89 |
doctype VARCHAR2(100), |
|
90 |
date_created DATE, |
|
91 |
date_updated DATE, |
|
92 |
CONSTRAINT xml_catalog_pk PRIMARY KEY (doctype) |
|
93 |
); |
|
94 |
|
|
95 |
CREATE TABLE xml_catalog_entities ( |
|
96 | 88 |
entity_id NUMBER(20), |
97 | 89 |
entity_name VARCHAR2(100), |
98 | 90 |
entity_type VARCHAR2(20), |
... | ... | |
102 | 94 |
system_id VARCHAR2(1000), |
103 | 95 |
date_created DATE, |
104 | 96 |
date_updated DATE, |
105 |
CONSTRAINT xml_catalog_entities_pk PRIMARY KEY (entity_id), |
|
106 |
CONSTRAINT xml_catalog_entities_uk UNIQUE (entity_type, source_doctype, target_doctype, public_id), |
|
107 |
CONSTRAINT xml_source_catalog_fk FOREIGN KEY (source_doctype) REFERENCES xml_catalog, |
|
108 |
CONSTRAINT xml_target_catalog_fk FOREIGN KEY (target_doctype) REFERENCES xml_catalog |
|
97 |
CONSTRAINT xml_catalog_pk PRIMARY KEY (entity_id), |
|
98 |
CONSTRAINT xml_catalog_uk UNIQUE (entity_type, source_doctype, target_doctype, public_id) |
|
109 | 99 |
); |
110 | 100 |
|
111 | 101 |
CREATE SEQUENCE xml_entity_id_seq; |
112 | 102 |
|
113 |
CREATE TRIGGER xml_cat_entities_before_insert
|
|
114 |
BEFORE INSERT ON xml_catalog_entities FOR EACH ROW
|
|
103 |
CREATE TRIGGER xml_catalog_before_insert
|
|
104 |
BEFORE INSERT ON xml_catalog FOR EACH ROW |
|
115 | 105 |
BEGIN |
116 | 106 |
SELECT xml_entity_id_seq.nextval |
117 | 107 |
INTO :new.entity_id |
xmltables.sql | ||
---|---|---|
21 | 21 |
|
22 | 22 |
DROP TRIGGER xml_nodes_before_insert; |
23 | 23 |
DROP TRIGGER xml_documents_before_insert; |
24 |
DROP TRIGGER xml_cat_entities_before_insert;
|
|
24 |
DROP TRIGGER xml_catalog_before_insert;
|
|
25 | 25 |
|
26 |
DROP TABLE xml_catalog_entities; |
|
27 | 26 |
DROP TABLE xml_catalog; |
28 | 27 |
DROP TABLE xml_documents; |
29 | 28 |
DROP TABLE xml_nodes; |
... | ... | |
83 | 82 |
/ |
84 | 83 |
|
85 | 84 |
/* |
86 |
* XML Catalog -- tables to store all external sources for XML documents
|
|
85 |
* XML Catalog -- table to store all external sources for XML documents |
|
87 | 86 |
*/ |
88 | 87 |
CREATE TABLE xml_catalog ( |
89 |
doctype VARCHAR2(100), |
|
90 |
date_created DATE, |
|
91 |
date_updated DATE, |
|
92 |
CONSTRAINT xml_catalog_pk PRIMARY KEY (doctype) |
|
93 |
); |
|
94 |
|
|
95 |
CREATE TABLE xml_catalog_entities ( |
|
96 | 88 |
entity_id NUMBER(20), |
97 | 89 |
entity_name VARCHAR2(100), |
98 | 90 |
entity_type VARCHAR2(20), |
... | ... | |
102 | 94 |
system_id VARCHAR2(1000), |
103 | 95 |
date_created DATE, |
104 | 96 |
date_updated DATE, |
105 |
CONSTRAINT xml_catalog_entities_pk PRIMARY KEY (entity_id), |
|
106 |
CONSTRAINT xml_catalog_entities_uk UNIQUE (entity_type, source_doctype, target_doctype, public_id), |
|
107 |
CONSTRAINT xml_source_catalog_fk FOREIGN KEY (source_doctype) REFERENCES xml_catalog, |
|
108 |
CONSTRAINT xml_target_catalog_fk FOREIGN KEY (target_doctype) REFERENCES xml_catalog |
|
97 |
CONSTRAINT xml_catalog_pk PRIMARY KEY (entity_id), |
|
98 |
CONSTRAINT xml_catalog_uk UNIQUE (entity_type, source_doctype, target_doctype, public_id) |
|
109 | 99 |
); |
110 | 100 |
|
111 | 101 |
CREATE SEQUENCE xml_entity_id_seq; |
112 | 102 |
|
113 |
CREATE TRIGGER xml_cat_entities_before_insert
|
|
114 |
BEFORE INSERT ON xml_catalog_entities FOR EACH ROW
|
|
103 |
CREATE TRIGGER xml_catalog_before_insert
|
|
104 |
BEFORE INSERT ON xml_catalog FOR EACH ROW |
|
115 | 105 |
BEGIN |
116 | 106 |
SELECT xml_entity_id_seq.nextval |
117 | 107 |
INTO :new.entity_id |
Also available in: Unified diff
clear xml_catalog table and rename xml_catalog_entities to xml_catalog