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 MySQL.
Databases:
See also Sybase Adaptive Server Enterprise to MySQL Migration.
Converting SQL language elements and constructs:
Sybase SQL Anywhere | MySQL | ||
1 | IF condition THEN exp ELSE exp2 ENDIF | IF expression | IF(condition, exp, exp2) |
Character data types:
Sybase SQL Anywhere | MySQL | |||
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 | MySQL | |||
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 | MySQL | |||
1 | DATE | Date (year, month and day) | DATE | |
2 | TIME | Time (hour, minute, second and microseconds fraction) | TIME(6) | |
3 | TIMESTAMP | Date and time with fraction (microseconds) | DATETIME(6) |
Binary data:
Sybase SQL Anywhere | MySQL | |||
1 | LONG BINARY | Binary data, ⇐ 2G | LONGBLOB |
Date and time functions:
Sybase ASA | MySQL | |||
1 | CURRENT TIMESTAMP | Get the current date and time | CURRENT_TIMESTAMP(6) | |
CURRENT_TIMESTAMP |
System functions:
Sybase ASA | MySQL | ||
1 | CURRENT USER | Get the authenticated user name | CURRENT_USER |
CURRENT_USER |
Converting user-defined SQL functions:
Sybase SQL Anywhere | MySQL | ||
1 | CREATE FUNCTION name | CREATE FUNCTION name | |
2 | (IN param type DEFAULT default, …) | (param type, …) | Default is not supported |
3 | RETURNS datatype(length) | RETURNS datatype(length) |
Converting stored procedures:
Sybase SQL Anywhere | MySQL | ||
1 | CREATE [OR REPLACE] PROCEDURE name | CREATE PROCEDURE name | |
2 | (IN | OUT | INOUT param type DEFAULT default, …) | (IN | OUT | INOUT param type, …) | Default is not supported |
Converting table definitions:
Sybase SQL Anywhere | MySQL | ||
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 | MySQL | ||
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 | MySQL | ||
1 | PRIMARY KEY(col [ASC | DESC], …) | Primary key | PRIMARY KEY(col [ASC | DESC], …) |
Foreign keys:
Sybase SQL Anywhere | MySQL | |||
1 | NOT NULL FOREIGN KEY | NULLs are not allowed | FOREIGN KEY | NOT NULL clause commented |
2 | FOREIGN KEY (col ASC | DESC, …) | Column ordering | Not supported for foreign keys, removed |