Inquisitor

Control Statements

There are currently three types of control statements. These are:
  • RECORD MATCHES
  • PRINT SEPARATOR CHARACTER
  • STRING COMPARISON

These can be used anywhere in the STATEMENT part of any Inquisitor section, but they must not be used in the EXEC_STATEMENT section(s). They can be called multiple times in any script.

RECORD MATCHES
By default all records in the relationship group that match the RECORD_STATEMENT(s) in a query section of the Inquisitor script will be selected. This can be limited to just one match if required. The syntax for this switch is:

QL_OUTPUT_ALL_MATCHESLOGICAL

The default state for this switch is.TRUE.; that is, that all matches will be output.

Examples:

  1. Turn off all matches (so that search in a relationship group will terminate after the first match)

    QL_OUTPUT_ALL_MATCHES.FALSE.>

  2. Turn all matches on (could be done after it has been turned off)

    QL_OUTPUT_ALL_MATCHES.TRUE.>

PRINT SEPARATOR CHARACTER
If PRINT commands are issued, without formatting the atoms, then the PRINT SEPARATOR character will separate the individual items printed. By default this is a SPACE character, but it can be set to anything else with the following command:

QL_PRINTSEPARATORCHAR

The character can be any printable character from the ASCII set, or one of a number of special characters which are entered as follows; TAB - \t, NEWLINE - \n, CARRIAGE RETURN - \r (to use \ as a separator character enter it as \\). For output suitable for loading into a spreadsheet, sensible alternative characters to the space are a comma or a tab character.

Examples:

  1. Set the PRINT SEPARATOR to a comma

    QL_PRINTSEPARATOR ','

  2. Set the PRINT SEPARATOR to a tab

    QL_PRINTSEPARATOR '\t'

STRING COMPARISON
Some database types, particularly old Fortran based ones (for example, Isis library) have fixed length string fields that are padded with blanks at the end. This can cause havoc with string comparison operations when comparing with literals (you have to remember to put the correct number of trailing spaces on the literal). For this reason, Inquisitor strips the trailing blanks from string fields when reading them from the database; this is the default behaviour. This behaviour can be set with the following command:

QL_REMOVE_TRAILING_BLANKSLOGICAL

Example:

  1. Turn off trailing blank removal

    QL_REMOVE_TRAILING_BLANKS.FALSE.>

  2. Turn on trailing blank removal

    QL_REMOVE_TRAILING_BLANKS.TRUE.>