Cleaning Up the Display

As you've followed the development of the index listing script, you no doubt saw the following lines interspersed in the output:

old   9:    AND ui.table_name = UPPER('&table_name')
new   9:    AND ui.table_name = UPPER('project_hours')

If you happened to execute the script against a table with more than a few indexed columns, you would have seen a message such as the following:

...
6 rows selected.

These lines add no value to running the script and serve only to clutter the output. It would be nice to get rid of them, and it is possible to do that by turning verification and feedback off. The commands to do that are described next.

Turning Off Verification

Verification refers to what SQL*Plus does when it encounters a line of script containing substitution variables. By default, SQL*Plus enables you to verify the substitution by displaying the old and the new versions of the line involved. The output from verification looks like this:

old   9:    AND ui.table_name = UPPER('&table_name')
new   9:    AND ui.table_name = UPPER('project_hours')

Sometimes it's useful to see these before and after images, especially when you are first developing a script, because they let you verify if your substitutions are being made correctly. Once you've developed a script, it's nice to be able to turn this output off, and you can do that by adding the following command to your script:

SET VERIFY OFF

Turning verification off makes your output a lot cleaner and is helpful if the script is a report that ...

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.