c# - .Net exe to migrate DB2 tables into CSV files -
trying extract db2 tables locally csv files can later import csvs sql server. code i'm working far , keeps blowing up. suggestions?
try { da_local.fill(td); } catch(exception e) { console.writeline("exception: {0}", e.message); } dqelibraries.importexport.exportdatasettocsvfile(td, @"c:\temp\"); console.writeline("exported file successfully"); } #region "environment detection" public static string currentenvironment() { //dqelibraries.configuration.getcurrentenvironment("db2"); string environmentoverride = "db2"; if (environmentoverride == "") { return dqelibraries.configuration.getcurrentenvironment(""); } else { return dqelibraries.configuration.getcurrentenvironment("db2"); } } #endregion } }
you may not need write own program this. db2 clp has utilities - please have @ export.
for example:
db2 "export staff.csv of del modified nochardel select * staff" hth.
Comments
Post a Comment