17.10 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Database Utilities

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Configuration
Publication ID
B035-1102-171K
Language
English (United States)

This program runs the utility specified by the -utility option passing it the input provided by either the -file or -commands option. The command is run by this program connecting to CNS on the node specified by the -machine option and starting the utility from the Supervisor subwindow of Database Window (DBW). When the utility issues a read, the commands specified are sent to it until all of the commands are exhausted or until the program exits.

To use this command, the user running cnsrun must have access permission to run a DBW session on the machine. To set up a user to have CNS access, use the GET PERMISSIONS, GRANT, and REVOKE commands in DBW. For more information about the DBW Supervisor Commands, see Database Window (xdbw).

An error occurs if all of the interactive partitions are in use.

By default, this command produces no output unless an error occurs.

When running the Ferret utility with CNS Run, you must specify the Ferret command

enable script

as the first command. This enables the script mode of Ferret, which allows scripts that run Ferret to run uninterrupted. For more information, see Ferret Utility (ferret).

Regular Expressions for the -prompt Option

Some database utilities prompt for input or commands. While those commands can be included in the command list, cnsrun needs to be able to recognize the utility prompts to know when to send the response. The -prompt option accepts regular expressions that represent utility program text prompts, to which cnsrun will respond by sending the next command in the command list.

The regular expression syntax follows that used in the Tool Command Language (Tcl), a subset of which is described below. For the full documentation on Tcl regular expressions, see http://wiki.tcl.tk/396.

Regular Expression Character Meaning
. A period in the regular expression matches any literal character at that position in the prompt string, to ensure that the prompt matches the regular expression.
? A question mark indicates the preceding character or group of characters in the regular expression can occur zero or one time at that position in the prompt string, to ensure that the prompt matches the regular expression.

Example: “fee?d” would match either “feed” or “fed” in the prompt string.

* An asterisk indicates the preceding character or group of characters in the regular expression can occur zero or more times in succession at that position in the prompt string, to ensure that the prompt matches the regular expression. This means that the pattern may or may not occur at that position in the prompt string.

Example: “fe*d” would match fed, feed, feeed, and would match fd, at the corresponding position in the prompt string.

+ A plus character indicates the preceding character or group of characters in the regular expression can occur one or more times in succession at that position in the prompt string, to ensure that the prompt matches the regular expression.

Example: “fe+d” would match fed, feed, feeed, but would not match fd.

^ A circumflex character in the regular expression indicates the character or characters that follow the circumflex in the regular expression must occur at the beginning of the prompt string, to ensure that the prompt matches the regular expression.

Example: “^E” requires that the prompt string begin with an upper case E so that it matches the regular expression.

$ A dollar sign character in the regular expression indicates the character or characters that precede the dollar sign in the regular expression must occur at the end of the prompt string, to ensure that the prompt matches the regular expression.

Example “:$” requires that the prompt string ends with a colon so that it matches the regular expression.

() Parentheses enclose a group of characters that is to be treated as a single regular expression entity.

Example: “(ABC)+” would match one or more successive occurrences of ABC at the corresponding position in a prompt string.

[] Square braces enclose a subset of characters to match.

Example: “[0-9]” would match any single digit at the corresponding position in a prompt string.