Project

General

Profile

« Previous | Next » 

Revision 3

added more tables for attribs and elements

View differences:

xmltables.sql
11 11
 */
12 12

  
13 13
/* 
14
 * Document -- table to store XML document catalog
14
 * Documents -- table to store XML document catalog
15 15
 */
16
DROP TABLE document;
17
CREATE TABLE document (
16
DROP TABLE documents;
17
CREATE TABLE documents (
18 18
	docid		NUMBER(20),
19
	rootnodeid	NUMBER(20),
19 20
	docname		VARCHAR2(1000),
21
	doctype		VARCHAR2(1000),
20 22
	date_created	DATE,
21 23
	date_updated	DATE,
22
   PRIMARY KEY document_pk (docid)
24
   PRIMARY KEY document_pk (docid),
25
   FOREIGN KEY fk_root_node (rootnodeid) REFERENCES elements
23 26
);
27

  
28
/* 
29
 * Elements -- table to store XML Elements
30
 */
31
DROP TABLE elements;
32
CREATE TABLE elements (
33
	nodeid		NUMBER(20),
34
	nodename	VARCHAR2(2000),
35
	nodedata	VARCHAR2(2000),
36
	date_created	DATE,
37
	date_updated	DATE,
38
   PRIMARY KEY elements_pk (nodeid)
39
);
40

  
41
/* 
42
 * Attributes -- table to store XML Attributes
43
 */
44
DROP TABLE attributes;
45
CREATE TABLE attributes (
46
	attributeid	NUMBER(20),
47
	nodeid		NUMBER(20),
48
	attributenumber	NUMBER(20),
49
	attributename	VARCHAR2(2000),
50
	attributevalue	VARCHAR2(2000),
51
	date_created	DATE,
52
	date_updated	DATE,
53
   PRIMARY KEY attributes_pk (attributeid),
54
   FOREIGN KEY fk_parent_node (nodeid) REFERENCES elements
55
);

Also available in: Unified diff