DB2自動生成模式中所有表的import和export語句
目的:方便不同數據庫之間的數據移植。
Sql代碼 www.2cto.com
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