从 IBM DB2 iSeries 到 SAP HANA 迁移
数据库迁移工具Ispirer MnMTK可以转换从DB2 iSeries到SAP HANA。您可以使用我们的转换工具为存储过程,功能,数据库图表(DDL),和其他数据库对象迁移。我们帮助我们的客户了解自动数据库和应用迁移解决方案的价值,使企业价值增长。
从DB2 iSeries迁移到SAP HANA概观
该工具迁移以下数据库的对象和属性到SAP HANA
- 存储过程,功能和触发器转换
- 数据库模式(DDL)转换
- 索引,视图和序列转换
- 数据迁移
DDL转换:
Ispirer转换解决方案
从DB2 iSeries 到SAP HANA 请求
Ispirer转换解决方案
从DB2 iSeries 到SAP HANA 服务
工具
如果您也需要从DB2 iSeries迁移到SAP HANA,请随时与我们联系。
DDL转换
- 列的定义转换:数据类型,默认值,NOT NULL 约束
- 主键和外键转换
如果您也需要从DB2 iSeries迁移到SAP HANA,请随时与我们联系。
转换存储过程:
DB2 iSeries:
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 iSeries:
CREATE FUNCTION HANA.REVERS(INSTR VARCHAR(4000), POS INT) RETURNS VARCHAR(1000) DETERMINISTIC NO EXTERNAL ACTION CONTAINS SQL BEGIN ATOMIC DECLARE REVSTR VARCHAR(4000); DECLARE LEN INT DEFAULT 0; SET LEN = LENGTH(INSTR); SET REVSTR = SUBSTR(INSTR, POS, LEN - POS +1); RETURN REVSTR; END ;
SAP HANA:
CREATE PROCEDURE HANA.REVERS(OUT RETURNVAL VARCHAR(1000), INSTR VARCHAR(4000), POS INTEGER) LANGUAGE SQLSCRIPT AS REVSTR VARCHAR(4000); LEN INTEGER DEFAULT 0; BEGIN LEN := LENGTH(:INSTR); REVSTR := SUBSTRING(:INSTR,:POS,:LEN -:POS+1); RETURNVAL := :REVSTR; END;
Triggers conversion:
DB2 iSeries:
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 iSeries:
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);
|