SDE & Oracle, encoding problem

310
1
05-29-2013 03:17 PM
CY
by
New Contributor II
Guys,

Recently we have this issue with UTF8 records from shape file to SDE/Oracle.

In shape file, we have "NAME" field storing UTF8 format characters ie "Á", "é", "á" etc. and they can be displayed correctly in ArcMAP. However, if we use shp2sde or tbl2sde commands to import it into SDE/Oracle, we get something like this "+¡" "+¦" etc. I know it is encoding issue, so I created a new column in the SDE layer called "NAME_UDF8" with datatype "NVARCHAR2" as below:


CREATE TABLE PP
  ([INDENT]ID      NUMBER(15,0),
             NAME    VARCHAR2(100 BYTE),
             NAME_UTF8 NVARCHAR2(100)
[/INDENT]
   )
  PCTFREE 10 PCTUSED 90 INITRANS 4 MAXTRANS 255 NOCOMPRESS NOLOGGING STORAGE
  ([INDENT]INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
[/INDENT]
   )
  TABLESPACE LRG_DATA ;



When I map the NAME field from the shape file to NAME_UTF8 column in SDE/Oracle, I got following error


Change column name from "NAME" to "NAME_UTF8".
Source and target table attribute schemas are not compatible.[INDENT]from  NAME_UTF8            STRING      100  0
  to    NAME_UTF8            NSTRING     100  0
[/INDENT]
Column type not compatible.
[INDENT]0      records processed.
0      records stored.

[/INDENT]


For the NAME field in the shape layer, it is as below:

NAME    TYPE    LENGTH
NAME    String    100



What we want is to have the special characters imported into SDE/Oracle.

Please help if you have any suggestions!
0 Kudos
1 Reply
VinceAngelo
Esri Esteemed Contributor
There may be entire books written about character set issues in Oracle.  In my experience,
if you didn't create the database with UTF-8 support and set the NLS_LANG environment
variable correctly in all the right locations (including Direct Connect clients), then it will not
be possible to get correct encoding in the database.  There isn't anything Esri-specific to this,
however, it's just the way Oracle rolls.

- V

PS: I should note that UTF-8 isn't generally NVARCHAR2, it's VARCHAR2; Oracle generally
bumps up to AL32UTF16 once it gets into NVARCHAR2.
0 Kudos