OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Command-Line Client

V2.2.13
  • Introduction
    • Overview of OBClient
  • Quick start
    • Quick start with OBClient
  • Command-line options
    • Common OBClient command-line options
    • Reference for OBClient command-line options
    • SQL context when a script fails
  • Configuration and environment
    • Configure OBClient and set environment variables
  • User guide
    • Reference for OBClient internal commands
  • Advanced features
    • Support for Oracle-compatible mode in OBClient
    • Log in to OBClient through a socket5 proxy
    • Multi-IP connection support for OBClient
    • Client IP passthrough and tenant allowlist (F5 scenario)
    • Log in as a proxy user of OBClient
    • LOAD DATA LOCAL INFILE
    • SET variables
    • Supported login_path options for OBClient
  • Tips and troubleshooting
    • OBClient Usage Tips and Troubleshooting

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Command-Line Client
  3. V2.2.13

SET variables

Last Updated:2026-09-02 09:17:42

SET DEFINE
SET FEEDBACK
SET ECHO
SET SQLBLANKLINES
SET HEADING
SET TERMOUT
SET PAGESIZE
SET TRIMSPOOL
SET EXITCOMMIT
SET SERVEROUTPUT
SET NUMWIDTH
References

OBClient supports various SET variables to control client behavior and output format. The following are some commonly used SET variables.

SET DEFINE

Sets the character used to prefix variable substitutions.

Syntax:

SET DEF[INE] {& | c | ON | OFF}

Description:

  • SET DEFINE ON: Sets the substitution character to & and turns on the feature.
  • SET DEFINE $: Sets the substitution character to $ and turns on the feature (the character must not be alphanumeric or contain spaces).
  • SET DEFINE OFF: Turns off the variable substitution feature.

Example:

SET DEFINE ON;
SET DEFINE $;
SET DEFINE OFF;

Note

Two consecutive occurrences of the substitution character indicate a permanent variable, while one occurrence indicates that the value must be entered. The system always reads from the permanent variable first; if it is empty, the user's input is used.

SET FEEDBACK

Controls the number of records displayed in query result feedback.

Syntax:

SET FEED[BACK] {6 | n | ON | OFF}

Description:

  • n: Displays the record count when the query returns at least n records (n must be 0-50000).
  • ON: Turns on feedback, equivalent to setting it to 1.
  • OFF: Turns off feedback.

SET FEEDBACK OFF also turns off statement confirmation messages displayed after SQL or PL/SQL statements succeed, such as "Table created" and "PL/SQL procedure successfully completed".

Example:

SET FEEDBACK ON;
SET FEEDBACK 10;
SET FEEDBACK OFF;

SET ECHO

Controls whether commands are echoed in scripts executed using source.

Syntax:

SET ECHO {ON | OFF}

Description:

  • ON: Displays commands on the screen.
  • OFF: Suppresses display.

ECHO does not affect the display of commands you enter interactively or output redirected from the operating system to OBClient.

SET SQLBLANKLINES

Controls whether SQL*Plus allows blank lines in SQL commands or scripts.

Syntax:

SET SQLBL[ANKLINES] {ON | OFF}

Description:

  • ON: Interprets blank lines and new lines as part of SQL commands or scripts.
  • OFF: Does not allow blank lines or new lines in SQL commands or scripts (default).

SET HEADING

Controls the printing of column headings.

Syntax:

SET HEA[DING] {ON | OFF}

Description:

  • ON: Prints column headings (default).
  • OFF: Suppresses column headings.

The SET HEADING OFF command does not affect the displayed column width; it only suppresses the printing of column headings themselves.

SET TERMOUT

Controls the display of output generated by commands in scripts executed using source.

Syntax:

SET TERM[OUT] {ON | OFF}

Description:

  • ON: Displays output on the screen (default).
  • OFF: Suppresses display so that you can spool output to a file instead of displaying it on the screen.

TERMOUT OFF does not affect the output of commands you enter interactively or output redirected from the operating system to OBClient.

Notice

Output is generated only for commands with ON set; otherwise, no output is generated.

SET PAGESIZE

Sets the number of rows displayed per page.

Syntax:

SET PAGES[IZE] {14 | n}

Note

This command is executable, but OBClient does not support it. It is only for compatibility with some Oracle scripts.

SET TRIMSPOOL

Controls whether trailing spaces in each line are trimmed in spooled output.

Syntax:

SET TRIMS[POOL] {ON | OFF}

Note

This command is executable, but OBClient does not support it. It is only for compatibility with some Oracle scripts.

SET EXITCOMMIT

Specifies whether the default exit behavior is COMMIT or ROLLBACK.

Syntax:

SET EXITC[OMMIT] {ON | OFF}

Note:

  • ON: Commits work upon exit (default).
  • OFF: Rolls back work upon exit.

Notice

This feature is valid in version 2.2.6.

SET SERVEROUTPUT

Enables or disables the output display of DBMS_OUTPUT.PUT_LINE().

Syntax:

SET SERVEROUT[PUT] {ON | OFF}

Description:

  • ON: Enables DBMS_OUTPUT output display.
  • OFF: Disables DBMS_OUTPUT output display.

SET NUMWIDTH

Sets the display width for numeric columns.

Syntax:

SET NUM[WIDTH] {10 | n}

Notice

This feature is disabled by default and must be enabled using an environment variable:export DISABLE_SET_NUM_WIDTH=0

References

  • Supported modes
  • Overview of OBClient

Previous topic

LOAD DATA LOCAL INFILE
Last

Next topic

Supported login_path options for OBClient
Next
on this page
SET DEFINE
SET FEEDBACK
SET ECHO
SET SQLBLANKLINES
SET HEADING
SET TERMOUT
SET PAGESIZE
SET TRIMSPOOL
SET EXITCOMMIT
SET SERVEROUTPUT
SET NUMWIDTH
References