Terminal Monitors

Terminal monitors interactively enter, edit, and execute individual queries or files containing queries. Terminal monitors also allow operating system level commands to be executed.

Windows: Ingres character-based utilities like Terminal Monitor will display characters correctly only if run under the supplied Ingres command prompt, which has the correct code page and font settings.

UNIX: Ingres character-based utilities like Terminal Monitor will display characters correctly only if the console window on which they are run has the correct code page set, which must match the character set value set in II_CHARSETxx for the database.

Previous Topic

Next Topic

Terminal Monitor Releases

There are two releases of the Terminal Monitor:

This appendix describes the line-based release, and includes instructions on how to invoke the Terminal Monitor and issue queries interactively.

For information about the forms-based release of the Terminal Monitor, see the Character-Based Querying and Reporting Tools User Guide.

Previous Topic

Next Topic

How Terminal Monitors Are Accessed

To access terminal monitors, you must type the following command at the operating system prompt:

sql [flags]

This sql command accepts a variety of flags that define how the Terminal Monitor and the DBMS Server operate during your session.

The following is a list of available flags and their descriptions:

Note: The history recall feature is only available on Linux platforms.

Previous Topic

Next Topic

Terminal Monitor Query Buffering

In the Terminal Monitor, each query that is typed is placed in a query buffer, rather than executed immediately. The queries are executed when the execution command (\go or \g) is typed. The results, by default, appear on your terminal.

For example, assume you have a table called, employee, that lists all employees in your company. If you want to see a list of those employees who live in a particular city (cityA), enter the following statement:

select name from employee where city=cityA
\g

The query is placed in the query buffer and executed when you enter \g. The returned rows display on your terminal. (If you type \g twice, your query is executed twice.)

Several other operations can also be performed on the query buffer, including:

After a \go command the query buffer is cleared if another query is typed in, unless a command that affects the query buffer is typed first. Commands that retain the query buffer contents are:

\append     or     \a
\edit       or     \e
\print      or     \p
\bell
\nobell

For example, typing:

help parts
\go
select * from parts

results in the query buffer containing:

select * from parts

Whereas, typing:

help parts
\go
\print
select * from parts

results in the query buffer containing:

help parts
select * from parts

This feature can be overridden by executing the \append command before executing the \go command, or by specifying the -a flag when issuing the sql command to begin your session.

Previous Topic

Next Topic

Terminal Monitor Commands

Terminal Monitor commands can manipulate the contents of the query buffer or your environment. Unlike the SQL statements that are typed into the Terminal Monitor, terminal monitor commands are executed as soon as the Return key is pressed.

All Terminal Monitor commands must be preceded with a backslash (\). If a backslash is entered literally, it must be enclosed in quotes. For example, the following statement inserts a backslash into the Test table:

insert into test values('\')\g

Some Terminal Monitor commands accept a file name as an argument. These commands must appear alone on a single line. The Terminal Monitor interprets all characters appearing on the line after such commands as a file name. Those Terminal Monitor commands that do not accept arguments can be stacked on a single line. For example:

\date\go\date

returns the date and time before and after execution of the current query buffer.

Terminal Monitor commands include:

Previous Topic

Next Topic

Terminal Monitor Messages and Prompts

The Terminal Monitor has a variety of messages to keep you informed of its status and that of the query buffer.

When logging in, the Terminal Monitor prints a login message that tells the release number and the login time. Following that message, the dayfile appears.

When the Terminal Monitor is ready to accept input and the query buffer is empty, the message go appears. The message, continue, appears instead if there is something in the query buffer.

The prompt >>editor indicates that you are in the text editor.

Previous Topic

Next Topic

Terminal Monitor Character Input and Output

When non-printable ASCII characters are entered through the Terminal Monitor, the Terminal Monitor replaces these characters with blanks. Whenever this occurs, the Terminal Monitor displays the message:

Non-printing character nnn converted to blank

where nnn is replaced with the actual character.

For example, if you enter the statement:

insert into test values('^La')

the Terminal Monitor converts the ^L to a blank before sending it to the DBMS Server and displays the message described above.

To insert non-printing data into a char or varchar field, specify the data as a hexadecimal value. For example:

insert into test values (x'07');

This feature can be used to insert a newline character into a column:

insert into test values ('Hello world'+x'0a');

This statement inserts 'Hello world\n' into the test table.

On output, if the data type is char or varchar, any binary data are shown as octal numbers (\000, \035, and so on.). To avoid ambiguity, any backslashes present in data of the char or varchar type are displayed as double backslashes. For example, if you insert the following into the test table:

insert into test values('\aa')

when you retrieve that value, you see:

\\aa

Previous Topic

Next Topic

The Help Statement

The Help statement displays information about a variety of SQL statements and features. For a complete list of help options, see Help in the chapter "SQL Statements."

Previous Topic

Next Topic

Aborting the Editor (VMS only)

Important!: In VMS environments, do not type Ctrl+Y and Ctrl+C while escaped to an editor (unless the editor assigns its own meaning to Ctrl+C) or VMS. VMS does not properly signal these events to the initiating process.


© 2007 Ingres Corporation. All rights reserved.