Differences

This shows you the differences between two versions of the page.

db2-to-mariadb [April 08, 2019 12:32 am]
sqlines
db2-to-mariadb [March 19, 2021 9:56 am] (current)
sqlines
Line 1: Line 1:
====== IBM DB2 to MariaDB Migration ====== ====== IBM DB2 to MariaDB Migration ======
-SQLines provides services and open-source tools to help you transfer data, convert database schema (DDL), views, stored procedures, functions, triggers, queries and SQL scripts from IBM DB2 to MariaDB.+SQLines tools can help you transfer data, convert database schema (DDL), views, stored procedures (SPL and COBOL), functions, triggers, queries and SQL scripts from IBM DB2 to MariaDB.
-We also help convert embedded SQL statements in C/C++ (ODBC, ESQL/C), C#, Java, PowerBuilder, VB/VB.NET, ASP/ASP.NET, Perl, PHP, Python, Linux shell and other applications. SQLines can also assist you to convert COBOL stored procedures and programs to MariaDB procedural language or Java. +  * [[/sqldata/db2-to-mariadb|SQLines Data]] - Data transfer, schema migration and validation tool 
 +  * SQLines SQL Converter - SQL scripts assessment and conversion tool
-Databases:+**Databases**:
  * IBM DB2 for LUW, z/OS and OS/400 11.x, 10.x, 9.x, 8.x and 7.x     * IBM DB2 for LUW, z/OS and OS/400 11.x, 10.x, 9.x, 8.x and 7.x  
  * MariaDB 10.x   * MariaDB 10.x
-===== DB2 to MariaDB Migration Tools ===== 
-SQLines tools to help you migrate from IBM DB2 to MariaDB: 
- 
-  * SQLines Data - Data Transfer, Schema Migration and Validation Tool  
-  * SQLines SQL Converter - SQL Scripts Conversion Tool  
-  * [[http://www.sqlines.com/online|Online SQL Conversion Tool]] 
===== DB2 to MariaDB Migration Reference ===== ===== DB2 to MariaDB Migration Reference =====
  * [[/db2-to-mariadb#data-types|Data Types]]   * [[/db2-to-mariadb#data-types|Data Types]]
 +  * [[/db2-to-mariadb#create-table-statement|CREATE TABLE]]
===== Data Types ===== ===== Data Types =====
 +
 +Character data types:
 +
 +| | **DB2** || **MariaDB** ||
 +| 1 | GRAPHIC(//n//) | Fixed-length UTF-16 string, 1 %%<=%% //n// %%<=%% 128 | CHAR(//n//) ||
 +| 2 | VARCHAR(//n// OCTETS) | Variable-length string in bytes, 1 %%<=%% //n// %%<=%% 32672 | VARCHAR(//n//) | //n// %%<=%% 65535 in characters {{:exclamation.png|}} |
 +| 3 | VARGRAPHIC(//n//) | Variable-length UTF-16 string, 1 %%<=%% //n// %%<=%% 16336 | VARCHAR(//n//) ||
Binary data types: Binary data types:
Line 32: Line 35:
| | **DB2** || **MariaDB** || | | **DB2** || **MariaDB** ||
-| 1 | DECFLOAT(16 %%|%% 34) | IEEE decimal floating-point number | DOUBLE ||+| 1 | BIGINT | 64-bit integer | BIGINT || 
 +| 2 | DECFLOAT(16 %%|%% 34) | IEEE decimal floating-point number | DOUBLE || 
 +| 3 | INT, INTEGER | 32-bit integer | INT, INTEGER || 
 +| 4 | SMALLINT | 16-bit integer | SMALLINT ||
Data and time data types: Data and time data types:
| | **DB2** || **MariaDB** || | | **DB2** || **MariaDB** ||
-| 1 | TIMESTAMP(//p//) | Date and time with fraction, 0 <= //p// <= 12 {{:exclamation.png|}}, default 6 | DATETIME(//p//) | //p// <= 6 |+| 1 | DATE | Date (year, month and day) | DATE || 
 +| 2 | TIMESTAMP(//p//) | Date and time with fraction, 0 %%<=%% //p// %%<=%% 12 {{:exclamation.png|}}, default 6 | DATETIME(//p//) | //p// %%<=%% 6 |
Large objects data types: Large objects data types:
Line 43: Line 50:
| | **DB2** || **MariaDB** || | | **DB2** || **MariaDB** ||
| 1 | BLOB(//n//) | Binary large object, 1 <= //n// <= 2G | LONGBLOB || | 1 | BLOB(//n//) | Binary large object, 1 <= //n// <= 2G | LONGBLOB ||
 +
 +===== CREATE TABLE Statement =====
 +
 +Converting CREATE TABLE statement from DB2 to MariaDB:
 +
 +| | **DB2** || **MariaDB** |
 +| 1 | FOR BIT DATA | Binary data encoding | Removed |
 +|:::| FOR SBCS %%|%% MIXED DATA | Column data encoding (z/OS) | Removed |
 +| 2 | CCSID ASCII %%|%% UNICODE %%|%% EBCDIC | Character set | Removed |
 +|:::| CCSID //num// | Column character set (OS/400) | Removed |
 +
 +Implicit DEFAULT values in DB2:
 +
 +| | **DB2** | **MariaDB** |
 +| 1 | //col_name// CHAR(//n//) WITH DEFAULT | //col_name// CHAR(//n//) DEFAULT %%''%% |
 +| 2 | //col_name// VARCHAR(//n//) WITH DEFAULT | //col_name// VARCHAR(//n//) DEFAULT %%''%% |
 +| 3 | //col_name// INTEGER WITH DEFAULT | //col_name// INTEGER DEFAULT 0 |
 +| 4 | //col_name// DECIMAL(//p, s//) WITH DEFAULT | //col_name// DECIMAL(//p, s//) DEFAULT 0 |
 +| 5 | //col_name// NUMERIC(//p, s//) WITH DEFAULT | //col_name// NUMERIC(//p, s//) DEFAULT 0 |
 +| 6 | //col_name// DATE WITH DEFAULT | //col_name// DATE DEFAULT CURRENT_DATE |
 +| 7 | //col_name// TIMESTAMP WITH DEFAULT | //col_name// TIMESTAMP DEFAULT CURRENT_TIMESTAMP |
 +
 +