This section describes the procedure for creating a table with abstract data type (SGMLTEXT type) that is provided by the HiRDB Text Search Plug-in.
A MEDICINE_MANAGEMENT_TABLE is created here. The following are the creation conditions:
Define the MEDICINE_MANAGEMENT_TABLE with CREATE TABLE. The following shows an example:
CREATE TABLE MEDICINE_MANAGEMENT_TABLE(
MEDICINE_ID MCHAR(15),
OPERATION_MANUAL SGMLTEXT 1.
ALLOCATE(SGMLTEXT IN((LOBAREA01),(LOBAREA02))) 2.
PLUGIN'<DTD>medicine.dtd</DTD>' 3.
)IN((RDAREA01)MEDICINE_ID<='MEDICINE 10',(RDAREA02)); 4.
CREATE TABLE MEDICINE_MANAGEMENT_TABLE(
MEDICINE_ID MCHAR(15),
OPERATION_MANUAL SGMLTEXT 1.
ALLOCATE(SGMLTEXT IN((LOBAREA01),(LOBAREA02))) 2.
PLUGIN'<DTD>medicine.dtd</DTD>' 3.
)PARTITIONED BY MEDICINE_ID
IN((RDAREA01)'MEDICINE 10',(RDAREA02)); 4.
Explanation:
CREATE TABLE MEDICINE_MANAGEMENT_TABLE(
MEDICINE_ID MCHAR(15),
OPERATION_MANUAL SGMLTEXT 1.
ALLOCATE(SGMLTEXT IN((LOBAREA01),(LOBAREA02))) 2.
PLUGIN'<DTD>medicine.dtd</DTD>' 3.
)[FIX]# HASH HASH6 BY MEDICINE_ID
IN(RDAREA01,RDAREA02) 4.
Explanation:
If you use the index type for data retrieval offered by a plug-in, you can retrieve data easily and at high speed. The index type offered by a plug-in is called plug-in index. This section explains how to define a plug-in index using the index type (NGRAM) provided by the HiRDB Text Search Plug-in.
The following example defines a plug-in index for MEDICINE_MANAGEMENT_TABLE using CREATE INDEX:
CREATE INDEX PLGINDX1
USING TYPE NGRAM
ON MEDICINE_MANAGEMENT_TABLE(OPERATION_MANUAL)
IN ((LOBAREA03),(LOBAREA04));
To use the database load utility (pdload) to store data in the table:
For details about these commands and utilities, and about how to verify the command and utility execution results, see the manual HiRDB Version 9 Command Reference.
If you have executed data loading, you should execute the database condition analysis utility (pddbst) next to check the data storage status. This utility enables you to check whether the database has been created exactly as designed. The database condition analysis utility (pddbst) can obtain the following information:
You can create a UAP using a hash function for table partitioning to create an input data file for each RDAREA. Because this makes it possible to check the amount of data to be stored in each RDAREA, you can select a hash function for uniform partitioning. For details about how to create a UAP for using a hash function for table partitioning, see the HiRDB Version 9 UAP Development Guide.