3.9.2 Storing data in the table
Once the input data path file has been created, store the sample data in the table.
When storing the sample data, use the input data path file that you just created and the import option file.
A file template is available for the import option file. Therefore, copy and use the template. The template is stored in the following location:
-
Import option file template: /home/adbmanager/server/sample/conf/adbimport.opt
The created input data path file and the import option file created by copying the template are stored in the following locations:
-
Input data path file: /home/adbmanager/path.txt
-
Import option file: /home/adbmanager/server/conf/
Use the import option file with its default settings.
- Organization of this subsection
(1) Copying the import option file template
To store the sample data in a table, copy the import option file template.
-
Copy the import option file template.
Enter the operating system command below and press Enter. The import option file template is copied.
cp /home/adbmanager/server/sample/conf/adbimport.opt /home/adbmanager/server/conf/
-
Check the copied import option file template.
Enter the operating system command below and press Enter. This checks whether the import option file template has been copied.
ls /home/adbmanager/server/conf/
■ Execution result example
adbimport.opt adbinit.opt client.def server.def
If the import option file template has been copied, executing the ls command displays adbimport.opt.
(2) Executing the command for storing data
As the HADB administrator (adbmanager), enter the HADB command below and press Enter.
In the command example below, a line feed has been entered before SAMPLE to improve readability. When entering the actual command, a line feed is not necessary. Enter a space after adbimport.opt and continue by entering SAMPLE and the information following it.
adbimport -u ADBUSER02 -p '#HelloHADB_02' -z /home/adbmanager/server/conf/adbimport.opt SAMPLE /home/adbmanager/path.txt
- Note
-
The adbimport command can be executed only when the HADB server is running. If the KFAA90004-E message is output, start the HADB server by following the explanation in (1) Executing the command to start the HADB server under 3.7.1 Starting the HADB server.
The following table shows the options that are specified for the adbimport command.
No. |
Option |
Description |
---|---|---|
1 |
-u ADBUSER02 |
Specifies the user ID (authorization identifier) of the HADB user who is executing the adbimport command. Here, ADBUSER02 is specified. |
2 |
-p '#HelloHADB_02' |
Specifies the password of the HADB user specified in the -u option. Here, #HelloHADB_02 is specified. |
3 |
-z /home/adbmanager/server/conf/adbimport.opt |
Specifies the import option file if you are specifying options when storing data. When storing the sample data, you must specify the import option file set to the default contents. Otherwise, an error will occur. |
4 |
SAMPLE |
Specifies the name of the table in which the data is to be stored. Since the sample data is to be stored in the table SAMPLE, specify SAMPLE. |
5 |
/home/adbmanager/path.txt |
Specifies the absolute path to the input data path file. |
(3) Confirming the data storage result
Messages are displayed when the adbimport command is executed. The following shows an example of the displayed results.
- ■ Example of the displayed results
-
KFAA90000-I adbimport processing started. KFAA80202-I Import processing started. The table is "ADBUSER02"."SAMPLE". KFAA80203-I 50 rows loaded. KFAA80204-I Import processing ended. (return code = 0) KFAA90001-I adbimport processing ended. (return code = 0)
The sample data has now been stored in the table.
(4) Related item
adbimport (Import Data) in the manual HADB Command Reference