Hi Ian,

I do have NVARCHAR2 columns and the NLS_NCHAR_CHARACTERSET is
AL16UTF16 in both schemas.

When trying to decode and encode according to your instruction I get:

UnicodeEncodeError: 'latin-1' codec can't encode characters in
position 4171134-4176189: ordinal not in range(256)

When looking at that position in the file I discovered that we had
some "chinese" chars there. And they shouldn't be there (-there seems
to be a problem when the size of a oracle CLOB field is exceeded).

So now I fount out what the problem is and I thank you for your
help..

Regards,
Johan


On 1 Dec, 19:54, Ian <[email protected]> wrote:
> On Dec 1, 9:29 am, Johan <[email protected]> wrote:
>
>
>
> > Hi,
>
> > I have two oracle schemas created with the same characterset
> > (NLS_CHARACTERSET = WE8ISO8859P1).
>
> > I get a  "DatabaseError: ORA-12704: character set mismatch" when doing
> > this:
> > 1) dumpdata to export data from a module named log in the first schema
> > and then
> > 2) loaddata to import the result into the second schema.
>
> > Stacktrace:
>
> > Problem installing fixture '../../data/fixtures/dev/r1797_20091201/
> > log.xml': Traceback (most recent call last):
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > core/management/commands/loaddata.py", line 153, in handle
> >     obj.save()
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > core/serializers/base.py", line 163, in save
> >     models.Model.save_base(self.object, raw=True)
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > db/models/base.py", line 495, in save_base
> >     result = manager._insert(values, return_id=update_pk)
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > db/models/manager.py", line 177, in _insert
> >     return insert_query(self.model, values, **kwargs)
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > db/models/query.py", line 1087, in insert_query
> >     return query.execute_sql(return_id)
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > db/models/sql/subqueries.py", line 320, in execute_sql
> >     cursor = super(InsertQuery, self).execute_sql(None)
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > db/models/sql/query.py", line 2369, in execute_sql
> >     cursor.execute(sql, params)
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > db/backends/util.py", line 19, in execute
> >     return self.cursor.execute(sql, params)
> >   File "/usr/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/
> > db/backends/oracle/base.py", line 434, in execute
> >     raise e
> > DatabaseError: ORA-12704: character set mismatch
>
> > Why do I get this "character set mismatch" when I have the same
> > character sets in the two schemas?
>
> > Thanks,
> > Johan
>
> Hi Johan,
>
> Do you only have VARCHAR2 / CLOB columns in the tables, or are there
> any NVARCHAR2 / NCLOB columns (which Django creates by default)?  If
> the latter, then what is the NLS_NCHAR_CHARACTERSET of each database?
>
> Also, the dumpdata output should be in utf-8.  Can you verify that it
> can be re-encoded as iso-8859-1 by running the code `file
> ('dumpdata.json').read().decode('utf-8').encode('iso-8859-1')`?
>
> Thanks,
> Ian

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to