Name

SET BLOCKTERMINATOR

Synopsis

The BLOCKTERMINATOR setting controls the character used to terminate a PL/SQL block being entered into the buffer for editing.

Syntax

SET BLO[CKTERMINATOR] {block_term_char | ON | OFF}

Parameters

SET BLO[CKTERMINATOR]

Is the command, which may be abbreviated SET BLO.

block_term_char

Is the new terminator character for use when entering PL/SQL blocks. The default value is a period.

ON

Enables the use of a block termination character and resets that character to the default of a period.

OFF

Disables the use of a block termination character, which means that the only way to terminate a block is to execute it using the forward slash (/).

Examples

When you enter a PL/SQL block into the buffer, you need a way to tell SQL*Plus when the block has ended. By default, the period can be used for this purpose, but you can use the SET BLOCKTERMINATOR command to change that. The following example changes the block terminator to a pound sign character:

SQL> SET BLOCKTERMINATOR #
SQL> BEGIN
  2    DBMS_OUTPUT.PUT_LINE('PL/SQL is powerful.');
  3  END;
  4  #
SQL>

Terminating the block this way leaves it in the buffer for you to edit. Don't confuse this with the use of the slash command, which terminates and executes a block.

Tip

Changing the terminator to a slash character by using SET BLOCKTERMINATOR / prevents you from subsequently using the / character to execute the contents of the buffer.

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.