Re: Dealing with UTF8 and loading data with SQL*Loader

  • From: angelo <angelolistas@xxxxxxxxx>
  • To: Mark Bobak <mark@xxxxxxxxx>
  • Date: Mon, 12 Jun 2017 15:55:55 -0300

Hello Mark,

Take a look on this article below

http://www.orafaq.com/wiki/SQL*Loader_FAQ

"Additionally, if your file was in Unicode, you could make the following
addition.

load data
 *CHARACTERSET UTF16*
 infile 'c:\data\mydata.csv'
 into table emp
 fields terminated by "," optionally enclosed by '"'            
 ( empno, empname, sal, deptno )

"

Maybe changing to UTF8..



On 12 June 2017 at 15:09, Mark J. Bobak <mark@xxxxxxxxx> wrote:

Hi All,

I'm running Oracle 12.1.0.2 Standard Edition

We have files in UTF8 that we are trying to load in SQL*Loader.  I've got
'CHARACTERSET' in the control file set to 'UTF8'.  The database is created
with AL32UTF8.

The file contains only standard English and some Spanish characters.  The
data is loading and characters are being interpreted correctly.

My problem is with the fact that the file contains fixed field length
data, and the control file is using 'POSITION(x:y)' parameters, to define
the fields.  For lines that only contain standard, single-byte characters,
everything works fine.  However, the POSITION parameter uses byte semantics
(regardless of the value of the 'LENGTH SEMANTICS' parameter).  So, if a
particular line has a two-byte character in it,every field following the
field with the two-byte character is off by one.  And, of course, if there
are multiple two-byte characters in a particular line, that line will be
off by n, where n is the number of two-byte characters in that particular
line.

I'm no SQL*Loader expert.....am I missing something obvious here?  Does
anyone have any idea how to solve this?

Thanks,

-Mark

Other related posts: