Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Insert Statement put invalid character data into UTF8 database/column
"Martin T." <bilbothebagginsbab5_at_freenet.de> wrote in message
news:1152011597.216322.47450_at_m79g2000cwm.googlegroups.com...
> sybrandb_at_yahoo.com wrote:
> > Martin T. wrote:
> > > Hi all. [Oracle 9i - 9.2.0.1.0]
> > >
> > > Can someone explain to me why a simple insert statements with no
> > > encoding convertions manages to put an invalid string into a database
> > > column?
> > >
> >
> > Invalid setting of NLS_LANG on the client, if a client is involved.
> >
> > Check out NLS_LANG in your NLS_SESSION_PARAMETERS view.
> >
> Thank!
> Finally I was able to repro the behaviour.
>
> The problem was the encoding part of the NLS_LANG client environment
> setting.
> If NLS_LANG=XXX_YYY.WE8ISO8859P1 then a text file containing this
> encoding will be converted when inserting into an UTF8 column.
> However, if the language setting is NLS_LANG=XXX_YYY.UTF8 then no
> conversion will take place and the ISO8859 bytes will just be inserted
> into the UTF8 column.
> If the client setting (NLS_LANG) is UTF8, then also the file has to be
> UTF8 encoded.
>
> best,
> Martin
>
Martin,
Yes, if the client and the db have the same nls_lang setting then Oracle
doesn't do any conversion. Hence the behavior you are seeing. SAP relies
on this behavior.
Jim
Received on Tue Jul 04 2006 - 11:13:41 CDT