SQL Dialect support of the WSO2 Data Services Server allows users to create multiple SQL queries for different SQL dialects by checking the driver. This helps maintain driver-specific functionality/key words in SQL statements of a single data service query.
For example, if a user wants to determine the data length retrieved from a column, there can be different ways to write the SQL query depending on the SQL driver.
Code Block |
---|
On MySQL and PostgreSQL:
SELECT OCTET_LENGTH(employeeNumber)
FROM Employees;
|
Code Block |
---|
On Microsoft SQL Server:
SELECT DATALENGTH(employeeNumber)
FROM Employees
|
Code Block |
---|
On Oracle:
SELECT LENGTH(employeeNumber)
FROM Employees
|