Neoview Command Interface (NCI) Guide (R2.3)
CS#mode sql
SQL>
OBEY Command
The OBEY command executes the SQL statements and NCI commands of a specified script file
or an entire directory. This command accepts a single filename or a filename with a wildcard
pattern specified. Executing the OBEY command without optional parameters prompts you to
enter a filename. If a filename is not specified, then *.sql is used.
Syntax
OBEY [script-file | wild-card pattern ] [ section-name ]
script-file
is the name of an ASCII text file that contains SQL statements, NCI commands, and comments.
If the script file exists outside the local directory where you launch NCI (by default, the
Neoview Command Interface bin directory), specify the full directory path of the script file.
(section-name)
is the name of a section within the script-file to execute. If you specify section-name,
the OBEY command executes the commands between the header line for the specified section
and the header line for the next section (or the end of the script file). If you omit
section-name, the OBEY command executes the entire script file. For more information,
see “Section Headers” (page 77).
wild-card-pattern
is a character string used to search for and display groups with names that match the character
string. wild-card-pattern matches a string (depends on the OS for case-sensitivity) unless
you enclose it within double quotes. To look for similar values, specify only part of the
characters of wild-card-pattern combined with these wild-card characters:
Use an asterisk (*) to indicate zero or more characters
of any type. For example, *art* matches SMART,
ARTIFICIAL, and PARTICULAR.
*
Use a question mark (?) to indicate any single character.
For example, boo? matches BOOK and BOOT but not
BOO or BOOTS.
?
Considerations
• You must enter the command on one line. The command does not require an SQL terminator.
• Put a space between OBEY and the first character of the file name.
• You can execute this command in a script file.
• Before putting dependent SQL statements across multiple files, consider the order of the
file execution. If a directory is not passed to the OBEY command, the file or wild-card is
assumed to be in the current working directory.
• If the (*) is issued in the OBEY command, all files are executed in the current directory. Some
of the files in the directory could be binary files. The OBEY command tries to read those
binary files and junk or invalid characters are displayed on the console. For example, this
command causes invalid characters to be displayed on the console:
SQL> obey C:\nci\bin\*
• Obey detects recursive obey files (for example, an sql file that calls OBEY on itself) and
prevents infinite loops using a max depth environment variable. If no variable is passed to
108 NCI Commands