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 22-3 shows the table that is defined in simple installation.
Figure 22-3 Table used in the examples
![[Figure]](figure/zu210030.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 RDAREA USR1 is assigned to the num column for chapter numbers.
- User LOB RDAREA ULOB1 is 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 RDAREA ULOB2 is assigned to it.
To define the table and index:
- 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))
PLUGIN '<DTD>MAN.DTD</DTD>'
)IN (USR1);
CREATE INDEX idx
USING TYPE NGRAM
ON manual(doc)
IN(ULOB2); |