Other Useful Commands [ Information Access Server: Database Administration ] MPE/iX 5.0 Documentation
Information Access Server: Database Administration
Other Useful Commands
Other useful commands for prompts and configuring a database are
described below.
Prompt Commands
The prompt commands allow you to enter parameter information when the
command file is run, rather than in the file itself.
This is useful both to make your command files more flexible and to
protect the security of your passwords, since they do not have to be
placed in a file where they can be read by others.
These commands, which collect the information to be used as a parameter,
must precede the commands that will use the parameter. The information
is stored and used when the command file encounters the parameter name
preceded by an exclamation point, as shown in the example below.
These commands will work for Host Batch Facility files, but not if they
are initiated from the PC.
These commands use a parameter that can be anything from a specific value
such as a password, to an operator in a query, or even an entire search
condition.
_____________________________________
| |
| |
| INPUT prompt parametername |
| |
_____________________________________
_______________________________________
| |
| |
| SECUREINPUT prompt parametername|
| |
_______________________________________
prompt--the prompt you want to appear on the screen when the command file
is run
parametername--the parameter name to be filled in as a keyword in another
command.
SECUREINPUT works the same as INPUT except that the characters will not
appear on the screen when they are typed in response to the prompt. A
series of asterisks (****) will appear in logfiles and when the commands
are echoed to the screen.
Prompts and parameter values are limited to 80 characters.
Here is an example of how the INPUT and SECUREINPUT commands could be
used to prompt for a user name and password.
INPUT "Please enter a user name" username
USER !username
SECUREINPUT "Please enter your password" password
REMOTE !username !password
In the next example, the INPUT command is used to make the command file
more flexible.
INPUT "Type customer name for search:" custname
INPUT "Type username:" username
SECUREINPUT "Type password:" password
REMOTE !username !password
SQL "SELECT &
* FROM SALES &
WHERE customer-name &
= '!custname';"
_____________________________________
| |
| |
| ASSIGN parametername value |
| |
_____________________________________
ASSIGN supplies a "hard coded" parameter and can be used for default
values for INPUT and SECUREINPUT commands.
Configuring a Database
The configuration process is used to create remote tables from existing
databases. SELECT commands are used to specify parameters and a
succeeding PERFORM_CFG command is needed to initiate the configuration
process.
NOTE In general, the DBA performs the configuration procedure through
the Administrator Utility, which makes these commands unnecessary
in most command files.
___________________________________________
| |
| |
| CONFIG_TAB dbase userpswd group acct|
| |
___________________________________________
dbase -- name of database to access
userpswd -- password needed to access the database
group -- group where the database resides
acct -- account where the database resides
Opens the database and obtains the dataset names that can be configured.
A succeeding SELECT command is used to select the dataset.
SELECT dataset
_____________________________________
| |
| |
| CONFIG_COL |
| |
_____________________________________
Selects columns for configuration. Succeeding SELECT commands are used
to supply the name of each column for configuration.
SELECT col1
SELECT col2
A PERFORM_CFG command is needed to initiate the sequence.
__________________________________________
| |
| |
| PERFORM_CFG tablename [description]|
| |
__________________________________________
tablename -- name of the newly configured table
description -- optional textual description of the table
Initiates the configuration process that in turn creates a table under
the specified name. The table description is saved along with the table
name.
Here is an example of the entire configuration sequence:
CONFIG_TAB dbname pswd group acct
SELECT dataset
CONFIG_COL
SELECT col1, col2, col3
PERFORM_CFG newtable "Payroll figures"
At this point, you can configure another database with a CONFIG_TAB
command or you can use a TABLE or SQL command to begin selecting table
data. A user name and password are not required if they have been
supplied earlier.
MPE/iX 5.0 Documentation