Setting Delimiters in DBeaver | Generated by AI

Home 2026.01

Question: How to set the delimiter in DBeaver? Sometimes for BEGIN/END stored procedure calls, I need to use @ as the end delimiter.

Answer:

In DBeaver, the most common and reliable way to handle stored procedures (especially in MySQL/MariaDB) that contain internal semicolons is to include DELIMITER commands directly in your script and execute the whole script properly.

Write your script like this in the SQL Editor:

DELIMITER @

CREATE PROCEDURE your_procedure_name()
BEGIN
    SELECT 'Hello';
    INSERT INTO log VALUES ('test');
    -- any statements with ; inside
END @

DELIMITER ;

How to execute it:

Alternative: Change the default statement delimiter in DBeaver settings

If you very frequently use @ (or another character) instead of ;, you can change DBeaver’s parsing delimiter:

  1. Go to Window → Preferences (or DBeaver → Settings on macOS)
  2. Navigate to Editors → SQL Editor → SQL Processing → Delimiters
  3. Set Statements delimiter to @
  4. (Optional) Check/uncheck Ignore native delimiter depending on your needs
  5. Click Apply and Close

After this change:

CREATE PROCEDURE your_procedure_name()
BEGIN
    SELECT 'Hello';
    -- statements
END @

Warning: Changing the global/default delimiter to @ can cause confusion with normal queries that use ;. Most users prefer the first method (using DELIMITER + Alt+X) because it keeps the change local to that script only.

Quick Summary – What usually works best

This method avoids changing global settings and works consistently across different connections.

References:


Back

x-ai/grok-4.1-fast

Donate