Editing a Teradata SQL Statement - Interactive Teradata Query Facility

Interactive Teradata Query User Guide

Product
Interactive Teradata Query Facility
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2452
Product Category
Teradata Tools and Utilities

The editing example presented below assumes that you are using the default PF key assignments.

Assume that, after keying the first seven lines of a lengthy statement, you realize that you have misspelled a word in the second line. To correct the word:

1 Press the PF21 key (assigned to the UP edit command) until the second line appears.

2 Move the cursor to the incorrect word.

3 Key the correct spelling over it.

4 Press the PF24 key (assigned to the DOWN edit command) to return to the line that you were keying so that you may complete the statement.

5 Press Enter to submit the statement for processing.

Note that, while you are executing the UP and DOWN edit commands, different statement lines are being moved into the first line of the input area opposite the arrow. If one of these lines is too long to fit on that line, the line is wrapped around into the second line of the input area, and the next line of the statement is positioned in the third line of the input area.

You may add a line to a statement by pressing the PF15 key (assigned to the ADD edit command). For example, to add a clause between lines 2 and 3 of the SELECT statement, shown previously.

1 Position the cursor at line 2.

2 Press PF15.

3 Key the new clause on the blank line created after line 2.

To delete a line from a statement:

1 Position the cursor anywhere on the line to be deleted.

2 Press the PF18 key (assigned to the REMOVE edit command) Entering and Editing Teradata SQL Statements.

To delete part of a line from any position in the line to the end of the line:

1 Position the cursor on the first character to be deleted.

2 Press the ERASE EOF key on the terminal keyboard.

To insert characters within a statement line:

1 Position the cursor at the point where the characters are to be added.

2 Press the INSERT key on the terminal keyboard.

3 Type the characters.

4 Press the Reset key to cancel insert mode.

To delete characters in a statement line:

1 Position the cursor on the first character to be deleted.

2 Press the DELETE key repeatedly until the characters are deleted.

To insert new material (for example, a clause) within a statement line that already extends across the screen:

1 Position the cursor at the point in the line where the insertion is to occur.

2 Press the PF key that you have assigned to the SPLIT command.

3 Insert the material on the split line.

To move the material on the next line to the current line:

1 Position the cursor at the point on the line where the material is to be moved.

2 Press the PF key that you have assigned to the JOIN command.

The material is moved to the current line, overwriting the cursor and any characters between the cursor and the end of the line.

When editing a complete statement (that is, one terminated by a semicolon) in the input area, be careful not to press Enter by accident, thereby inadvertently entering the statement before it is ready to be processed.