SQLCL
KEYMAP
REFERENCE

ORACLE SQLcl · 2025

EDITING MODES
EMACS MODE (DEFAULT)
Always in insert mode. Type to insert text. Use Ctrl/Alt shortcuts for commands. Example: Ctrl+A (beginning), Ctrl+E (end), Alt+B (back word)
VI INSERT MODE (VIINS)
Type to insert text. Press Esc to switch to command mode. Example: Type "SELECT" → Esc → Now in command mode
VI COMMAND MODE (VICMD)
Navigate and edit with single keys. Press i to insert, a to append. Example: h (left), l (right), w (word forward), dd (delete line)
HOW KEYMAPS WORK ACROSS MODES
Alt+R (History Search)
Works in ALL modes - EMACS, VIINS, VICMD
Alt+U (Uppercase Word)
Works in ALL modes - converts "select" → "SELECT"
Ctrl+E
VIINS only - switches to EMACS mode
QUICK REFERENCE
Most SQLcl keymaps (Alt+R, Alt+N, Alt+A, Alt+E, Alt+U, Alt+C, etc.) work universally across all modes. You don't need to think about modes unless you're using Vi keybindings.
HISTORY SEARCH
Alt+R
Search history backward (prefix match: "SEL" finds "SELECT...")
Alt+<
Jump to oldest command in history
Alt+>
Jump to newest command / clear current line
TEXT CASE MANIPULATION
Alt+C
Capitalize word: hello → Hello
Alt+U
Uppercase word: select → SELECT (perfect for SQL keywords)
Alt+L
Lowercase word: EMPLOYEES → employees
KILL/YANK (CUT/PASTE)
Ctrl+U
Kill entire line (save to kill ring clipboard)
Ctrl+K
Kill from cursor to end of line
Ctrl+W
Kill word backward
BUFFER NAVIGATION
Alt+A
Beginning of buffer (multi-line SQL: jump to first line)
Alt+E
End of buffer (multi-line SQL: jump to last line)
Ctrl+\
Cancel edit / goto end of buffer
Esc
Cancel edit / goto end of buffer (alternative)
EXECUTION CONTROL
Enter
Accept line (execute if at end, newline if editing middle)
Ctrl+R
Run immediately (bypass prompts, execute now)
Ctrl+C
Send interrupt signal (cancel operation)
DISPLAY CONTROL
Ctrl+L
Clear screen (refresh terminal display)
Alt+!
Redraw display (force buffer redraw)
Alt+G
Collect garbage
EDITING MODE
Ctrl+E
Switch to Emacs editing mode (from Vi insert)
SMART MULTI-LINE HANDLERS
Up Arrow
Move up one line (if editing) OR previous history (if at end)
Down Arrow
Move down one line (if editing) OR next history (if at end)
Backspace/Delete
Smart delete with auto screen-clear on large buffers
SET COMMANDS
SET AUTOSUGGESTIONS
Enable/disable auto-suggestions from history
SET LINENUMBERS
Enable/disable line numbers in multi-line mode
SET STATUSBAR
Enable/disable status bar display
SET HIGHLIGHTING
Enable/disable SQL syntax highlighting
SET HISTORY
Configure command history settings
SET LINESIZE
Set display width for data (e.g., SET LINESIZE 120)
SET PAGESIZE
Set number of lines per page
SET SQLFORMAT
Set output format (ANSICONSOLE, JSON, CSV, XML, HTML, etc.)
SET SERVEROUTPUT
Enable/disable DBMS_OUTPUT display
SET TIMING
Display query execution time
SET AUTOCOMMIT
Enable/disable auto-commit after each statement
SET FEEDBACK
Display row count feedback (e.g., "5 rows selected")
SET HEADING
Enable/disable column headings in query output
SET ECHO
Display commands before execution (for scripts)
SET VERIFY
Show before/after substitution variables
SET AUTOTRACE
Enable automatic EXPLAIN PLAN and statistics
SET COMMANDS - DISPLAY
SET COLSEP
Set column separator (default: space)
SET NULL
Set text to display for NULL values
SET NUMFORMAT
Set default number display format
SET NUMWIDTH
Set default width for number columns
SET LONG
Set maximum width for LONG, CLOB, NCLOB columns
SET LONGCHUNKSIZE
Set fetch size for LONG columns
SET ARRAYSIZE
Set number of rows fetched per database access
SET MAXROWS
Limit number of rows returned by query
SET TRIMOUT
Trim trailing spaces in output
SET TRIMSPOOL
Trim trailing spaces in spooled output
SET WRAP
Enable/disable line wrapping for long lines
SET PRINTTHEME
Set color theme for terminal output
SET COMMANDS - ADVANCED
SET SQLBLANKLINES
Allow blank lines in SQL statements
SET SQLCASE
Convert SQL keywords to UPPER/LOWER/MIXED
SET SQLTERMINATOR
Set SQL statement terminator (default: ;)
SET BLOCKTERMINATOR
Set PL/SQL block terminator (default: /)
SET DEFINE
Set substitution variable prefix (default: &)
SET ESCAPE
Set escape character for substitution variables
SET CONCAT
Set concatenation character for variables (default: .)
SET SQLPROMPT
Customize SQL prompt (e.g., SET SQLPROMPT "DB> ")
SET ERRORLOGGING
Log errors to table for analysis
SET CODESCAN
Enable code scanning for security issues
SET DDL
Show DDL for database objects
SET CLOUDCONFIG
Configure Oracle Cloud settings
SET WALLET
Configure Oracle Wallet for secure connections
SET EXITCOMMIT
Commit changes on exit (ON/OFF)
SET EDITOR
Set external editor for EDIT command
HELP SET <var>
Get detailed help for specific SET variable

ORACLE SQLCL

Press Ctrl+P to print