从 IBM DB2 AS/400 到 SAP HANA 迁移
数据库迁移工具Ispirer MnMTK可以转换从DB2 AS/400到SAP HANA。您可以使用我们的转换工具为存储过程,功能,数据库图表(DDL),和其他数据库对象迁移。我们帮助我们的客户了解自动数据库和应用迁移解决方案的价值,使企业价值增长。
从DB2 AS/400到SAP HANA迁移概观
该工具迁移以下数据库的对象和属性到SAP HANA
- 存储过程,功能和触发器转换
- 数据库模式(DDL)转换
- 索引,视图和序列转换
- 数据迁移
DDL转换:
Ispirer转换解决方案
从 DB2 AS/400 到 SAP HANA 请求
Ispirer转换解决方案
从 DB2 AS/400 到 SAP HANA 服务
工具
如果您也需要从DB2 AS/400迁移到SAP HANA,请随时与我们联系。
DB2 AS/400:
CREATE TABLE EMPLOYEE (EMP_NO INT NOT NULL, SALARY DOUBLE NOT NULL, FIRST_NAME VARCHAR(12) NOT NULL, DATESTART DATE DEFAULT CURRENT DATE, PRIMARY KEY (EMP_NO) ) ;
SAP HANA:
CREATE TABLE EMPLOYEE ( EMP_NO INTEGER NOT NULL, SALARY DOUBLE NOT NULL, FIRST_NAME VARCHAR(12) NOT NULL, DATESTART DATE DEFAULT CURRENT_DATE, PRIMARY KEY(EMP_NO) );
转换存储过程:
- 转换程序的语法,游标语句
- 转换变量和参数
- 转换评论
DB2 AS/400:
CREATE PROCEDURE MEDIAN_RESULT_SET (MedianSalary DOUBLE) RESULT SETS 1 LANGUAGE SQL BEGIN DECLARE c2 CURSOR WITH RETURN FOR SELECT EMP_NO, SALARY FROM EMPLOYEE WHERE SALARY > MedianSalary ORDER BY SALARY; OPEN c2; END;
SAP HANA:
CREATE TYPE SWT_MEDIAN_RESULT_SET AS TABLE(EMP_NO INTEGER, SALARY DOUBLE); CREATE PROCEDURE MEDIAN_RESULT_SET(medianSalary DOUBLE, OUT SWV_Result SWT_MEDIAN_RESULT_SET) LANGUAGE SQLSCRIPT AS BEGIN SWV_Result = SELECT EMP_NO, SALARY FROM EMPLOYEE WHERE SALARY > :MedianSalary ORDER BY SALARY; END;
转换触发器:
DB2 AS/400:
CREATE TRIGGER RAISE_LIMIT AFTER UPDATE OF SALARY ON EMPLOYEE REFERENCING NEW AS N OLD AS O FOR EACH ROW WHEN (N.SALARY > 1.1 * O.SALARY) BEGIN DECLARE MAX_SALARY FLOAT; SELECT MAX(SALARY) INTO MAX_SALARY FROM EMPLOYEE WHERE EMP_NO = O.EMP_NO; IF N.SALARY > MAX_SALARY THEN UPDATE SAMPLE SET SALARY = N.SALARY WHERE EMP_NO = O.EMP_NO; END IF; END;
SAP HANA:
CREATE TRIGGER RAISE_LIMIT AFTER UPDATE ON EMPLOYEE REFERENCING NEW ROW N,OLD ROW O FOR EACH ROW BEGIN DECLARE MAX_SALARY FLOAT; IF :N.SALARY > 1.1*:O.SALARY THEN SELECT MAX(SALARY) INTO MAX_SALARY FROM EMPLOYEE WHERE EMP_NO = :O.EMP_NO; IF :N.SALARY > :MAX_SALARY THEN UPDATE SAMPLE SET SALARY = :N.SALARY WHERE EMP_NO = :O.EMP_NO; END IF; END IF; END;
转换视图:
DB2 AS/400:
CREATE VIEW VW_BONUS(customer, bonus) AS SELECT name, total/items_count * rate FROM CUSTOMERS INNER JOIN ORDERS ON CUSTOMERS.id = ORDERS.order_id WHERE date_of_birth >= CURRENT_DATE - 18 YEARS ;
SAP HANA:
CREATE VIEW VW_BONUS(customer, bonus) AS SELECT name, total/items_count*rate FROM CUSTOMERS JOIN ORDERS ON CUSTOMERS.id = ORDERS.order_id WHERE date_of_birth >= ADD_YEARS(CURRENT_DATE,-18);
|