SQL dialects

The TSqlDialect value controls the format of date, time, datetime, and boolean literals in SQLExpression and SQLValues[]. String and numeric literals are not affected by the dialect. The default dialect is sqlElevateDB. Set it once per application with SetSQLDialect, or supply it per call via the full overload of ParseInput.

Dialect identifiers

Identifier Target database
sqlMySQL MySQL 5.x+ / MariaDB 10.x+
sqlElevateDB ElevateDB 2.x+
sqlDBISAM DBISAM 4.x
sqlPostgreSQL PostgreSQL 9.x+
sqlMSSQLServer Microsoft SQL Server 2008+
sqlSQLite SQLite 3.x+
sqlFirebird Firebird 3+ / InterBase
sqlOracle Oracle 11g+
sqlAccess Microsoft Access (Jet / ACE)
sqlBDEParadox BDE / Paradox

Date literals (itDate)

Dialect Format Example
sqlMySQL DATE 'yyyy-mm-dd' DATE '2026-03-25'
sqlElevateDB DATE 'yyyy-mm-dd' DATE '2026-03-25'
sqlDBISAM 'yyyy-mm-dd' '2026-03-25'
sqlPostgreSQL DATE 'yyyy-mm-dd' DATE '2026-03-25'
sqlMSSQLServer 'yyyy-mm-dd' '2026-03-25'
sqlSQLite 'yyyy-mm-dd' '2026-03-25'
sqlFirebird DATE 'yyyy-mm-dd' DATE '2026-03-25'
sqlOracle TO_DATE('yyyy-mm-dd','YYYY-MM-DD') TO_DATE('2026-03-25','YYYY-MM-DD')
sqlAccess #yyyy-mm-dd# #2026-03-25#
sqlBDEParadox "dd.mm.yyyy" "25.03.2026"

Time literals (itTime)

The [.fff] suffix is included only when milliseconds are non-zero. Zero milliseconds always produce a plain hh:mm:ss literal.

Dialect Format (no ms) Format (with ms) Notes
sqlMySQL TIME 'hh:mm:ss' TIME 'hh:mm:ss.fff' 3-digit ms
sqlElevateDB TIME 'hh:mm:ss' TIME 'hh:mm:ss.fff' 3-digit ms
sqlDBISAM 'hh:mm:ss' 'hh:mm:ss.fff' 3-digit ms
sqlPostgreSQL TIME 'hh:mm:ss' TIME 'hh:mm:ss.fff' 3-digit ms
sqlMSSQLServer 'hh:mm:ss' 'hh:mm:ss.fff' 3-digit ms
sqlSQLite 'hh:mm:ss' 'hh:mm:ss.fff' 3-digit ms
sqlFirebird TIME 'hh:mm:ss' TIME 'hh:mm:ss.ffff' 4-digit ten-thousandths (ms × 10)
sqlOracle TO_TIMESTAMP('hh:mm:ss','HH24:MI:SS') TO_TIMESTAMP('hh:mm:ss.fff','HH24:MI:SS.FF3') 3-digit ms
sqlAccess #hh:mm:ss# #hh:mm:ss# ms dropped
sqlBDEParadox "hh:mm:ss" "hh:mm:ss" ms dropped

Firebird note: Firebird stores sub-second time as ten-thousandths of a second (0–9999). The parser multiplies the parsed milliseconds by 10 to produce the 4-digit value. For example, 500 ms is stored as 5000 ten-thousandths and the literal is TIME '09:30:15.5000'.

DateTime / TIMESTAMP literals (itDateTime)

The [.fff] / [.ffff] suffix follows the same rules as for time literals above.

Dialect Format (no ms) Format (with ms) Notes
sqlMySQL 'yyyy-mm-dd hh:mm:ss' 'yyyy-mm-dd hh:mm:ss.fff' 3-digit ms
sqlElevateDB TIMESTAMP 'yyyy-mm-dd hh:mm:ss' TIMESTAMP 'yyyy-mm-dd hh:mm:ss.fff' 3-digit ms
sqlDBISAM 'yyyy-mm-dd hh:mm:ss' 'yyyy-mm-dd hh:mm:ss.fff' 3-digit ms
sqlPostgreSQL TIMESTAMP 'yyyy-mm-dd hh:mm:ss' TIMESTAMP 'yyyy-mm-dd hh:mm:ss.fff' 3-digit ms
sqlMSSQLServer 'yyyy-mm-dd hh:mm:ss' 'yyyy-mm-dd hh:mm:ss.fff' 3-digit ms
sqlSQLite 'yyyy-mm-dd hh:mm:ss' 'yyyy-mm-dd hh:mm:ss.fff' 3-digit ms
sqlFirebird TIMESTAMP 'yyyy-mm-dd hh:mm:ss' TIMESTAMP 'yyyy-mm-dd hh:mm:ss.ffff' 4-digit ten-thousandths (ms × 10)
sqlOracle TO_TIMESTAMP('yyyy-mm-dd hh:mm:ss','YYYY-MM-DD HH24:MI:SS') TO_TIMESTAMP('yyyy-mm-dd hh:mm:ss.fff','YYYY-MM-DD HH24:MI:SS.FF3') 3-digit ms
sqlAccess #yyyy-mm-dd hh:mm:ss# #yyyy-mm-dd hh:mm:ss# ms dropped
sqlBDEParadox "dd.mm.yyyy hh:mm:ss" "dd.mm.yyyy hh:mm:ss" ms dropped

Boolean literals (itBoolean)

Dialect True False
sqlMySQL TRUE FALSE
sqlElevateDB TRUE FALSE
sqlDBISAM TRUE FALSE
sqlPostgreSQL TRUE FALSE
sqlMSSQLServer 1 0
sqlSQLite 1 0
sqlFirebird TRUE FALSE
sqlOracle 1 0
sqlAccess True False
sqlBDEParadox TRUE FALSE

String literals

String literals are dialect-independent. Every itString token is wrapped in single quotes using Delphi’s QuotedStr convention: internal single quotes are doubled.

O'Brien   →   'O''Brien'

Numeric literals

Integer, decimal, and float literals are dialect-independent. The decimal separator is always . regardless of the runtime locale.

itDecimal: 1,99  →  1.9900
itFloat:   1,5   →  1.5

LIKE patterns

The ESCAPE '\' clause appended to LIKE expressions is dialect-independent, with one exception: sqlBDEParadox does not receive an ESCAPE clause because BDE SQL layer support for it is unreliable. See Operators for details.

(C) 2026 Easygate, Lda