Tuesday, June 25, 2013

0 Using cursor to load data across schema/database

 

Use cursor to move data between tables

db2 "DECLARE MYCURS1 CURSOR FOR SELECT * FROM DEPARTMENT"
 
db2 LOAD FROM MYCURS1 OF CURSOR INSERT INTO DB2DEMO.DEPARTMENT

image

Use cursors to move data between database

 

db2 "DECLARE MYCURS2 CURSOR DATABASE sample10 user db2inst1 using XXXXX FOR SELECT * FROM DEPARTMENT"
 
db2 LOAD FROM MYCURS2 OF CURSOR INSERT INTO DB2DEMO.DEPARTMENT

image

Reference

http://www.ibm.com/developerworks/data/library/techarticle/dm-0901fechner/

0 comments:

Post a Comment

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates