Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / February 2008

Tip: Looking for answers? Try searching our database.

Problems with Import of UTF-8 files -  Differences between LOAD and IMPORT

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stefan - 18 Feb 2008 12:21 GMT
Hi,

When I import data from an CSV file, data seems to be converted (into
iso-8851-1 ???) although the csv data and the db are in utf-8 format.
I also tried "modified by codepage=1208" but it failed too. (but with
different import results):
import from xy.csv of del modified by coldel; replace into tmp

If I do the same statement with LOAD instead of IMPORT it works fine.

DB was created with:
CREATE DATABASE testdb USING CODESET UTF-8 TERRITORY DE.
The CSV file was saved in utf-8 format with open office.
Before connecting to the database locale was set with "export
LANG=de_DE.UTF-8"

DB2/LINUX 7.2.9 (V7 with fixpack 12)

I know this is an old DB2 Version but Migration is planned for next year.

Thanks for any hint

Stefan
Colin Booth - 19 Feb 2008 17:42 GMT
> Hi,
>
[quoted text clipped - 19 lines]
>
> Stefan

I think that I have had a similar problem (a few years ago with V7) Try
setting the DB2CODEPAGE variable to 1208 for the client.

Colin
Stefan - 20 Feb 2008 12:41 GMT
Colin Booth schrieb:

> I think that I have had a similar problem (a few years ago with V7) Try
> setting the DB2CODEPAGE variable to 1208 for the client.
>
> Colin

I've tried that but the behavior is the same.
I will use LOAD now. It's not the best solution (tablespace access is
denied) but I hope that IMPORT will work too after migration to V9.

thanks for your feedback.

Stefan
db2admin - 28 Feb 2008 16:25 GMT
> Colin Booth schrieb:
>
[quoted text clipped - 10 lines]
>
> Stefan

Hello,
I was having similar issues as well and I remember keeping codepage
same on source and destination databases as well as OS
or as long as they support the language. I was exporting german and
importing back into another database in a another server.
I read following articles which were great help

http://www.ibm.com/developerworks/db2/library/techarticle/0210lau/0210lau.html
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0506chong/

regards
Stefan - 29 Feb 2008 13:51 GMT
> Hello,
> I was having similar issues as well and I remember keeping codepage
[quoted text clipped - 7 lines]
>
> regards

Hi,

thanks for the links.
I already had read the 2nd one, but the first was new for me and
explained me why load and import show different behavior.
Load assumes that the file is encoded in the DB codepage, import assumes
that the file is encoded in the current system code page.

I now assume that the problem is the interpretion of the system
codepage. Our system codepage is iso-8859-1, but before connecting to
the database I manually set locale to utf-8. So I thought import should
use (the shell enviroment) utf-8 but it seems that import assumed that
codepage is iso-8859-1.

regards
Stefan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.