DB2自动生成模式中所有表的import和export语句
 
目的:方便不同之间的数据移植。 
 
Sql代码 www.2cto.com  
SELECT  
    ' 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