xiaodouya33 发表于 2016-11-17 03:48:39

DB2自动生成模式中所有表的import和export语句

目的:方便不同数据库之间的数据移植。

SELECT
'DB2 EXPORT TO ' || tabname ||
'.DEL OF DEL MODIFIED BY COLDEL@ CODEPAGE=1208 MESSAGES ' || tabname ||
'.expout SELECT * FROM ' || tabname AS Exports, 'IMPORT FROM ' || tabname || '.del OF DEL MODIFIED BY CODEPAGE=1208 COLDEL@ MESSAGES ' ||
tabname || '.impout REPLACE INTO ' || tabname AS Imports
FROM
syscat.tables
WHERE
tabschema = CURRENT schema
页: [1]
查看完整版本: DB2自动生成模式中所有表的import和export语句