Hello everybody,
I am trying to export the data from DB2 database to MySQL.
The command I used is
db2 "export to sys_state.del of del modified coldel; select * from sys_state"
But, I tried to modify the chardel to be blank, by default chardel for del is "". I tried to move it out.
So, I ever tried to use below command later on
db2 -x "select * from sys_state" > sys_state.out
However, what I got is no coldel, which means there is blank between the values.
Even though, I tried to use those blank to be the chardel when I load into MySQL.
Unfortunately, I found there are blank before the first value for all rows exported from DB2, so it will cause the first column null if I use the blank to be the coldel.
So, do you guys have another method that I can try to export data from DB2 that I can use ';' to be the coldel and remove "" outside the character data
For example, by default, the export data is below,
1,"Peter",123 45
Now, how to change it to
1;Peter;12345
Thanks so much!!
Cheers,
zhif
I am trying to export the data from DB2 database to MySQL.
The command I used is
db2 "export to sys_state.del of del modified coldel; select * from sys_state"
But, I tried to modify the chardel to be blank, by default chardel for del is "". I tried to move it out.
So, I ever tried to use below command later on
db2 -x "select * from sys_state" > sys_state.out
However, what I got is no coldel, which means there is blank between the values.
Even though, I tried to use those blank to be the chardel when I load into MySQL.
Unfortunately, I found there are blank before the first value for all rows exported from DB2, so it will cause the first column null if I use the blank to be the coldel.
So, do you guys have another method that I can try to export data from DB2 that I can use ';' to be the coldel and remove "" outside the character data
For example, by default, the export data is below,
1,"Peter",123 45
Now, how to change it to
1;Peter;12345
Thanks so much!!
Cheers,
zhif
Comment