Line Editing

The concept of line-editing goes way back to the days when all many people had to work with were dumb terminals that didn't allow full-screen editing, and connection speeds were so slow that full-screen editing would have been very painful anyway. A good line editor will allow you to work productively at connection speeds as low as 300 bits per second. While working at that speed isn't much of a concern today, it accurately reflects the environment at the time SQL*Plus was first conceived.

The line-editing process in SQL*Plus follows these steps:

  1. Enter a SQL statement or PL/SQL block, which SQL*Plus stores in the buffer.

  2. List the contents of the buffer to the screen.

  3. Enter SQL*Plus commands telling SQL*Plus to make changes to the statement or block in the buffer.

  4. List the buffer again.

  5. If you like what you see, execute the statement or block; otherwise, you go back to step 3 and make some more changes.

I can remember that in my younger days my fellow programmers and I always took great pride in the number of line-editing changes we could make and visualize in our heads before we had to break down and list our code again.

The Current Line

When working with the line editor in SQL*Plus, you must understand the concept of the current line. The current line is the one that you have most recently "touched." When you are entering a statement, the most recently entered line is the current line.

The statement shown in Example 2-9 is six lines long. Line 7 doesn't count and is not added ...

Get Oracle SQL*Plus: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.