(Contents)(Next)

Starting QUERY

Format:

Starting QUERY (general format)

query

After the connect, you are in input mode where SQL statements can then be entered.

Specifying a TIMEOUT Value

The SESSION TIMEOUT value determines the time interval at the end of which the session will be terminated if it was not active. The database administrator can determine this value for the whole database or for a single user on his creation (default: 300 seconds). The option -t allows the user to specify a smaller value in seconds. A value larger than predefined produces an error message.

query -t 90

The database session started with this command is terminated after 90 seconds of inactivity.

Starting QUERY in SELECT Mode

query -s

In SELECT mode, only read accesses to database objects can be performed. This mode is valid during the whole QUERY session.

Specifying an SQLMODE

The option -S can be used to specify the SQLMODE desired for the start. If the option is not used, QUERY works in default mode ADABAS.

Specifying a Command File With the Start

In QUERY, command files can be started interactively or in batch mode. Calls are for the

1) interactive mode:

query -u parker,secret -d testdb -r filename

QUERY executes the statements of the command file and then displays the input window.

2) batch mode:

query -u parker,secret -d testdb -b filename

In this case, QUERY suppresses any screen interaction and terminates after execution.

The command file is always executed in asynchronous mode; i.e., it can also run as background process.

3) execution with parameter transfer

query -r filename 21.00 Mayr

query -b filename 21.00 Mayr

In this example, the values '21.00' and 'Mayr' are assigned to the formal parameters of the command file 'filename'. The blank has the effect of a separator between two parameters.

Specifying a Command With the Start

In QUERY, stored commands can be started interactively or in batch mode. Calls are for the

1) interactive mode:

query -u parker,secret -d testdb -R HOTEL

QUERY executes the specified command and then displays the input window.

2) batch mode:

query -u parker,secret -d testdb -B HOTEL

In this case, QUERY suppresses any screen interaction and terminates after execution.

The stored command is always executed in asynchronous mode; i.e., it can also run as background process.

3) execution with parameter transfer

query -R command1 21.00 Mayr

query -B command1 21.00 Mayr

In this example, the values '21.00' and 'Mayr' are assigned to the formal parameters of the stored command 'COMMAND1'. The blank has the effect of a separator between two parameters.

Exporting or Importing Stored Commands in Batch Mode

query -e HOTEL,hotel.qsc

query -i *,my.qsc

In the first example, QUERY exports the stored command 'HOTEL' into the DOS file 'hotel.qsc'. In the second example, QUERY imports all stored commands recorded in the DOS file 'my.qsc'. In both cases, no screen interaction takes place. QUERY terminates after execution.

Specifying '-A' (APPEND) ensures that text is added at the end of an already existing file rather than overwriting the file.

Starting QUERY With the QUERY Command 'LIST'

query -L

Connecting is done in a similar way to that described for the general QUERY start. You do not access the input mode but the menu of the stored QUERY commands is displayed. You can then execute any displayed command but cannot create new commands.


(Contents)(Next)