Thursday, November 11, 2010

SQLLoader with text file format

When loading text file into db via sqlloader, there might be the case that varchar2 column with Thai character data turn out weird (i.e. instead of showing "รถยนต์นั่งไม่เกิน 7 คน" it turn out to be "เธžเธฃเธš เธฃเธ–เธขเธ™เธ•เนŒเธ™เธฑเนˆเธ‡เน„เธกเนˆเน€เธเธดเธ™ 7 เธ„เธ™").

The cause of this problem, from what I experienced, is that the format/encoding of text file is invalid.
To solve this you need to open the file with your fave text editor, then use "save as" menu and choose file format/encoding as ANSI/ASCII (default one is the current format/encoding of the file).