21 |
21 |
DROP SEQUENCE xml_nodes_id_seq;
|
22 |
22 |
DROP SEQUENCE xml_revisions_id_seq;
|
23 |
23 |
DROP SEQUENCE xml_catalog_id_seq;
|
|
24 |
DROP SEQUENCE xml_relation_id_seq;
|
24 |
25 |
|
25 |
26 |
DROP TRIGGER xml_revisions_before_insert;
|
26 |
27 |
DROP TRIGGER xml_catalog_before_insert;
|
|
28 |
DROP TRIGGER xml_relation_before_insert;
|
27 |
29 |
|
|
30 |
DROP INDEX xml_relation_index;
|
|
31 |
|
28 |
32 |
DROP TABLE xml_index;
|
29 |
33 |
DROP TABLE xml_catalog;
|
30 |
34 |
DROP TABLE xml_access;
|
... | ... | |
32 |
36 |
DROP TABLE xml_documents;
|
33 |
37 |
DROP TABLE xml_nodes;
|
34 |
38 |
DROP TABLE xml_acc_numbers;
|
|
39 |
DROP TABLE xml_relation;
|
35 |
40 |
|
36 |
41 |
/*
|
37 |
42 |
* Nodes -- table to store XML Nodes (both elements and attributes)
|
... | ... | |
188 |
193 |
local_id NUMBER(20), -- second part - unique in global name
|
189 |
194 |
CONSTRAINT xml_acc_numbers_pk PRIMARY KEY (global_name, local_id)
|
190 |
195 |
);
|
|
196 |
|
|
197 |
CREATE TABLE xml_relation (
|
|
198 |
relationid NUMBER(20) PRIMARY KEY, -- unique id
|
|
199 |
subject VARCHAR2(1024) NOT NULL, -- the subject of the relation
|
|
200 |
subdoctype VARCHAR2(256), -- the doctype of the subject
|
|
201 |
relationship VARCHAR2(512) NOT NULL, -- the relationship type
|
|
202 |
object VARCHAR2(1024) NOT NULL, -- the object of the relation
|
|
203 |
objdoctype VARCHAR2(256) -- the doctype of the object
|
|
204 |
);
|
|
205 |
CREATE UNIQUE INDEX xml_relation_index
|
|
206 |
ON xml_relation(relationid, subject, relationship, object);
|
|
207 |
|
|
208 |
CREATE SEQUENCE xml_relation_id_seq;
|
|
209 |
|
|
210 |
CREATE TRIGGER xml_relation_before_insert
|
|
211 |
BEFORE INSERT ON xml_relation FOR EACH ROW
|
|
212 |
BEGIN
|
|
213 |
SELECT xml_relation_id_seq.nextval
|
|
214 |
INTO :new.relationid
|
|
215 |
FROM dual;
|
|
216 |
END;
|
|
217 |
/
|
|
218 |
|
added package and resource data and structures