SQLines tools can help you transfer data, convert database schema (DDL), views, stored procedures, functions, triggers, queries and SQL scripts from SAP SQL Anywhere, Sybase SQL Anywhere, Sybase Adaptive Server Anywhere (Sybase ASA) to MariaDB.
Databases:
See also Sybase Adaptive Server Enterprise to MariaDB Migration.
Converting SQL language elements and constructs:
Sybase SQL Anywhere | MariaDB | ||
1 | IF condition THEN exp ELSE exp2 ENDIF | IF expression | IF(condition, exp, exp2) |
Character data types:
Sybase SQL Anywhere | MariaDB | |||
1 | CHAR(n) | Variable-length string, not padded, 1 ⇐ n ⇐ 32767 | CHAR(n⇐255) | TEXT |
2 | LONG VARCHAR | Character data, ⇐ 2G | LONGTEXT |
Unicode data:
Numeric data types:
Sybase SQL Anywhere | MariaDB | |||
1 | BIGINT | 64-bit integer | BIGINT | |
2 | DECIMAL(p,s) | Fixed point number | DECIMAL(p,s) | |
3 | DOUBLE [PRECISION] | Double-precision floating-point number | DOUBLE [PRECISION] | |
4 | INTEGER, INT | 32-bit integer | INTEGER, INT | |
5 | NUMERIC(p,s) | Fixed point number | NUMERIC(p,s) | |
6 | SMALLINT | 16-bit integer | SMALLINT |
Date and time data types:
Sybase SQL Anywhere | MariaDB | |||
1 | DATE | Date (year, month and day) | DATE | |
2 | DATETIME | Date and time with fraction (microseconds) | DATETIME(6) | |
3 | TIME | Time (hour, minute, second and microseconds fraction) | TIME(6) | |
4 | TIMESTAMP | Date and time with fraction (microseconds) | DATETIME(6) |
Binary data:
Sybase SQL Anywhere | MariaDB | |||
1 | LONG BINARY | Binary data, ⇐ 2G | LONGBLOB |
String functions:
Date and time functions:
System functions:
Sybase ASA | MariaDB | ||
1 | CURRENT USER | Get the authenticated user name | CURRENT_USER |
CURRENT_USER |
Converting user-defined SQL functions:
Converting stored procedures:
Converting table definitions:
Sybase SQL Anywhere | MariaDB | ||
1 | DEFAULT TIMESTAMP | Auto-updated timestamp | DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) |
2 | DEFAULT LAST USER | User modified row | DEFAULT CURRENT_USER |
Data type attributes:
Sybase SQL Anywhere | MariaDB | ||
1 | UNSIGNED integer_type | Non-negative integer | integer_type UNSIGNED |
2 | INLINE num | Data type attribute | Removed |
3 | PREFIX num | Data type attribute | Removed |
Constraints:
Sybase SQL Anywhere | MariaDB | ||
1 | PRIMARY KEY(col [ASC | DESC], …) | Primary key | PRIMARY KEY(col [ASC | DESC], …) |
Foreign keys:
Converting T-SQL statements from Sybase ASA to MariaDB:
Sybase SQL Anywhere | MariaDB | |||
1 | DECLARE name EXCEPTION FOR SQLSTATE [VALUE] val | User-defined exception | DECLARE name CONDITION FOR SQLSTATE [VALUE] val | SQLSTATE values are different |
Exception block:
Converting error codes from Sybase ASA to MariaDB:
Sybase SQL Anywhere | MariaDB | |||
1 | SQLSTATE '52003' | Name of the column could not be found | SQLSTATE '42S22' | Unknown column '%s' in '%s' |