Name

SET COLSEP

Synopsis

The COLSEP setting changes the text that prints between columns of data.

Syntax

SET COLSEP column_separator

Parameters

column_separator

Is the text you want to print between columns. You should enclose this text in quotes if it contains any spaces or punctuation.

Examples

The default column separator is a single space. The following example shows how you can change it to a comma:

SQL> SET COLSEP ","
SQL> SELECT 'One' one,
  2         'Two' two
  3    FROM dual;
ONE,TWO
---,---
One,Two

Like a space, the comma in this example is a single character. You aren't limited to one character though. You could just as easily change the column separator to a string of several characters.

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.