The shortcut to run a SQL command in Oracle depends entirely on which tool you are using. In SQL*Plus and SQL Developer, the standard is Ctrl+Enter (Windows/Linux) or Cmd+Enter (macOS) to execute the current statement or script. In SQLcl, the same Ctrl+Enter works. In Oracle APEX's SQL Workshop, use Ctrl+Enter as well. If you are in a plain terminal running SQL*Plus, there is no shortcut key at all: you type the statement, end it with a semicolon, and press Enter. This guide covers the real shortcuts for each common Oracle client, plus what to do when the key combination does nothing.
What You'll Need
- An Oracle client installed: SQL*Plus (command-line), SQL Developer, SQLcl, or access to Oracle APEX in a browser.
- A valid database connection (username, password, host, port, service name).
- For SQL Developer: the current version from Oracle's official download page. Menu labels can differ slightly by version, device, and region.
- Keyboard focus inside the SQL worksheet or editor pane, not in the connection tree or a results grid.
Step-by-Step
- Open your Oracle tool and connect. In SQL Developer, expand the Connections panel, double-click your saved connection, and wait for the worksheet to open. In SQLcl, start the session with
sql username/password@host:port/service. In APEX, go to SQL Workshop > SQL Commands. - Click into the SQL editor pane. The shortcut only fires when the editor has focus. Click once on the line containing your statement. In SQL Developer this is the large upper pane labeled Worksheet; in APEX it is the command editor box.
- Type or paste your SQL statement. For a single statement, do not add a trailing semicolon in SQL Developer or APEX; the tool sends the statement as-is. In SQL*Plus and SQLcl, a semicolon or a forward slash on its own line is required to execute.
- Press the run shortcut. On Windows and Linux: Ctrl+Enter. On macOS: Cmd+Enter. SQL Developer also accepts F5 to run the entire worksheet as a script (all statements), while Ctrl+Enter runs only the statement under the cursor or the selected text. SQLcl uses Ctrl+Enter in its interactive prompt when line editing is enabled; otherwise press Enter after the semicolon.
- Check the output. In SQL Developer, results appear in the Script Output or Query Result tab below the editor. In SQLcl and SQL*Plus, output prints directly in the terminal. In APEX, results render below the command box.
- For a multi-statement script, select the statements first. Highlight the block you want, then press Ctrl+Enter (or Cmd+Enter). Only the selection runs. If nothing is selected, SQL Developer runs the statement where the cursor sits.
- Commit if you changed data. In SQL Developer, click the Commit button (green checkmark) or run
COMMIT;. In SQL*Plus and SQLcl, typeCOMMIT;and press Enter. Autocommit is off by default in most Oracle clients, so uncommitted changes roll back when you disconnect.
Common Mistakes
- Pressing Ctrl+Enter with focus in the wrong pane. If the Connections tree or a result grid has focus, the shortcut does nothing or triggers a different action. Click the editor first.
- Adding a semicolon in SQL Developer or APEX. A trailing semicolon can cause an ORA-00911 invalid character error because the client already terminates the statement. Remove it.
- Forgetting the semicolon in SQL*Plus or SQLcl. Without it, the prompt sits at a continuation line (SQL> becomes 2>) and nothing executes. Type
;and press Enter, or type/on its own line to run the buffer. - Using F5 when you meant Ctrl+Enter. F5 runs the whole worksheet, which can re-run destructive statements you did not intend. Use Ctrl+Enter for the current statement only.
- Assuming the shortcut is the same in every tool. Third-party clients such as DBeaver, TOAD, or VS Code extensions have their own bindings. Check that tool's keymap settings.
- Not committing. The statement appears to succeed, but the change is lost on disconnect. Run
COMMIT;explicitly.
Tips
- In SQL Developer, Ctrl+Enter runs one statement; F5 runs the script; F9 runs the statement and shows results in a grid. Learn the difference before running anything that modifies data.
- Select just the statement you want before pressing the shortcut to avoid running neighbors in a long script.
- Use
SET AUTOCOMMIT ONin SQL*Plus or SQLcl only when you are sure; it commits every statement immediately and removes your chance to roll back. - In SQL Developer, check the keymap under Tools > Preferences > Shortcut Keys if Ctrl+Enter conflicts with another binding. Labels vary by version.
- Keep a
ROLLBACK;habit: run it after a test update to confirm you changed only the intended rows before committing. - In APEX SQL Commands, Ctrl+Enter runs the command; use the Run button if the shortcut is captured by the browser.
Troubleshooting
If the shortcut does nothing, first click directly in the SQL editor and try again. Then confirm the connection is open (the connection name should not show a red icon in SQL Developer). If you get ORA-00911, remove the trailing semicolon. If you get ORA-00933 (SQL command not properly ended), check for a missing or extra terminator. If the prompt shows 2> in SQL*Plus or SQLcl, you are in continuation mode: type ; and press Enter, or type / alone on a line. If results appear in the wrong tab, switch to Script Output or Query Result. If the key combination is captured by your operating system or another app, reassign it in the client's shortcut settings. Restart the client if the editor becomes unresponsive, and update to the current version from Oracle's official site. If a statement seems to hang, check for an uncommitted lock held by another session before cancelling.
Frequently Asked Questions
What is the shortcut to run a SQL command in Oracle SQL Developer?
Ctrl+Enter on Windows and Linux, Cmd+Enter on macOS. F5 runs the entire worksheet as a script, and F9 runs the statement into a results grid.
Is there a run shortcut in SQL*Plus?
No. SQL*Plus is a terminal tool: end the statement with a semicolon and press Enter, or type a forward slash on its own line to run the buffered statement.
Why does Ctrl+Enter give me ORA-00911?
You likely included a trailing semicolon. SQL Developer and APEX add the terminator themselves, so remove it from the editor.
How do I run only part of a script?
Select the statements you want, then press Ctrl+Enter (Cmd+Enter on macOS). Only the highlighted text executes.
Does the shortcut work in Oracle APEX?
Yes, in SQL Workshop > SQL Commands, Ctrl+Enter runs the command. If the browser intercepts it, use the Run button.
Why did my update disappear after I ran it?
You did not commit. Oracle clients usually run with autocommit off, so run COMMIT; before disconnecting.