This section explains the definition of a table for storing the SGML documents in order to create a database and the definition of the index that is needed for data retrieval.
Figure 23-3 shows the table that is defined in simple installation.
Figure 23-3 Table used in the examples
![[Figure]](figure/zu220030.gif)
- The table called manual consists of the column num for storing manual's chapter numbers and the column doc for storing manual's SGML documents.
- User RDAREAs USR1 and USR2 are assigned to the num column for chapter numbers.
- User LOB RDAREAs ULOB1 and ULOB2 are assigned to the doc column for the SGML documents.
- An index named idx for making retrievals from manual's SGML documents is defined and then user LOB RDAREAs ULOB3 and ULOB4 are assigned to it.
To define the table and index, use the following procedure:
- Enter HiRDB's pddef command.
- Enter the information shown as follows. Use the Enter key for linefeeds.
- When step 2 is completed, press [Ctrl] + [D] to terminate the pddef command. The table is defined and the pddef command is terminated.
CREATE TABLE manual(
num CHAR(10) NOT NULL,
doc SGMLTEXT
ALLOCATE(SGMLTEXT IN((ULOB1),(ULOB2)))
PLUGIN '<DTD>MAN.DTD</DTD>'
)IN((USR1) <= '1',
(USR2));
CREATE INDEX idx
USING TYPE NGRAM
ON manual(doc)
IN((ULOB3),(ULOB4)); |