You can customize the batch files for creating the sample database to define tables and load data to the tables. To customize batch files, you must be familiar with SQL and the database load utility (pdload). For details about SQL, see the manual HiRDB Version 9 SQL Reference. For details about the database load utility (pdload), see the manual HiRDB Version 9 Command Reference.
- Note
- At the point when HiRDB has been installed and has just started, the registered authorization identifier and password are both root. The root user has the DBA privilege. Therefore, root is the authorization identifier and password in the client environment definitions (hirdb.ini) during the sample database setup.
- Organization of this subsection
- (1) Adding a new user
- (2) Defining tables and indexes
- (3) Loading data to the tables
- (4) Creating a batch file for executing commands under aliases
It may not be possible to execute a HiRDB operation command because it has the same name as an OS command or a command provided by another program. In this case, the following actions can be taken:
- Use the environment variable setting that gives HiRDB commands precedence over other commands.
- Specify the absolute path of the command to be executed.
If neither of these actions can be taken, there is a way to execute a HiRDB operation command under a user-defined name. HiRDB provides a sample batch file for this purpose.
(a) Name of sample batch file provided by HiRDB
The table below lists and describes the sample batch file provided by HiRDB. This file is stored in the following directory:
(b) Procedure for creating an alias for a command
To create an alias for an operation command:
- Copy the sample batch file into a desired directory. To create aliases for multiple commands, copy the file once for each of the commands. Do not copy it into the bin or lib directory under the HiRDB directory.
- Set the copy target directory for the sample file in the PATH environment variable or path as the search path.
- Rename the file copied in step 1 to the alias of the HiRDB operation command. For example, command name pdmod might be changed to hirmod.
- Open the copied sample file and change the part shown in the following figure as cc...cc to the name of the HiRDB command you want to execute as an alias.
Figure 22-2 Sample batch file
![[Figure]](figure/zu230060.gif)
This procedure enables a HiRDB operation command to be executed under any desired name. Options can be specified in the alias command in the same manner as with the normal HiRDB operation command.
(c) Notes
- A name other than the HiRDB operation command name must be assigned to a copy of the sample file.
- It is possible that the %PDDIR%\bin and %PDDIR%\lib directories under the HiRDB directory may be deleted in their entirety during uninstallation. For this reason, sample files must not be copied into these directories.
- To call a sample batch file from within another batch file, use call. Otherwise, the system may not be able to return control to the initial batch file.
- The contents of the sample files must not be changed, except for setting a HiRDB operation command name.
- To cancel execution of a created alias command during command processing, the HiRDB command process must be terminated at an extension of the alias process. Terminating the alias process does not automatically terminate the HiRDB command process.
- If a created alias command is executed and another process is terminated while the HiRDB command is waiting for a response to be entered, HiRDB command execution may result in an error or the response entry wait status may still be in effect. If the response entry wait status is still in effect, the HiRDB command process must be terminated.