latest patch - also try not specifiying use_ansi=False, it should detect that 
now





On May 18, 2010, at 2:04 PM, Kent wrote:

> It specifically says NCHAR is not usable *for unicode* until Oracle
> 9i.  (Showing my ignorance here: are you certain NVARCHAR2 uses
> NCHAR?  Seems logical to me.)
> 
> The white paper further states: "No Unicode character set is supported
> as the national character set prior to Oracle 9i".  I believe the "N"
> in NVARCHAR2 stands for "national" so my best guess is you are correct
> that NVARCHAR2 is useless in oracle 8 (as far as Unicode is
> concerned).
> 
> 
> I caught the Exception as we discussed earlier and then set
> unicode_for_unicode = False in engine/default.py.
> 
> Now I'm getting a problem later with unicode:
> 
> Traceback (most recent call last):
>  File "/home/rarch/tg2env/bin/paster", line 8, in <module>
>    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')
> ()
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run
>    invoke(command, command_name, options, args[1:])
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in
> invoke
>    exit_code = runner.run(args)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 68, in
> run
>    return super(AbstractInstallCommand, self).run(new_args)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run
>    result = self.command()
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 456, in
> command
>    self, config_file, section,
> self.sysconfig_install_vars(installer))
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 598, in
> setup_config
>    mod.setup_app, command, filename, section, vars)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 612, in
> _call_setup_app
>    func(command, conf, vars)
>  File "/home/rarch/trunk/src/appserver/pylotengine/websetup.py", line
> 32, in setup_app
> 
> model.metadata.create_all(bind=config['pylons.app_globals'].sa_engine)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/schema.py", line
> 1958, in create_all
>    bind.create(self, checkfirst=checkfirst, tables=tables)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1504, in create
>    self._run_visitor(ddl.SchemaGenerator, entity,
> connection=connection, **kwargs)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1535, in _run_visitor
>    visitorcallable(self.dialect, conn,
> **kwargs).traverse_single(element)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/sql/visitors.py",
> line 77, in traverse_single
>    return meth(obj, **kw)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/ddl.py",
> line 36, in visit_metadata
>    collection = [t for t in sql_util.sort_tables(tables) if
> self._can_create(t)]
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/ddl.py",
> line 29, in _can_create
>    return not self.checkfirst or not
> self.dialect.has_table(self.connection, table.name,
> schema=table.schema)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/dialects/oracle/
> base.py", line 626, in has_table
>    name=self.denormalize_name(table_name),
> schema_name=self.denormalize_name(schema))
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1109, in execute
>    return Connection.executors[c](self, object, multiparams, params)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1186, in _execute_clauseelement
>    return self.__execute_context(context)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1215, in __execute_context
>    context.parameters[0], context=context)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1284, in _cursor_execute
>    self._handle_dbapi_exception(e, statement, parameters, cursor,
> context)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1282, in _cursor_execute
>    self.dialect.do_execute(cursor, statement, parameters,
> context=context)
>  File "/home/rarch/tg2env/lib/python2.6/site-packages/
> SQLAlchemy-0.6.0.1-py2.6-linux-x86_64.egg/sqlalchemy/engine/
> default.py", line 281, in do_execute
>    cursor.execute(statement, parameters)
> sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12704: character set
> mismatch
> 'SELECT table_name FROM all_tables WHERE table_name = :name AND owner
> = :schema_name' {'name': u'TG_PERMISSION', 'schema_name': u'ARC'}
> install.sh: failed trying to run setup-app
> 
> 
> I assume your suggestion that "types.Unicode() renders VARCHAR2, not
> NVARCHAR2, when oracle 8 is detected" would fix this problem, correct?
> 
> 
> 
> 
> On May 18, 1:33 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
>> so here is the proposal - types.Unicode() renders VARCHAR2, not NVARCHAR2, 
>> when oracle 8 is detected.
>> 
>> since NVARCHAR2 is essentially useless on oracle 8, correct ?
>> 
>> when I used to use oracle 8 we used VARCHAR2 for unicode data.  i wasn't 
>> aware of the N- types at that time.
>> 
>> also the suite of changes here is going to roll in the "use_ansi" flag into 
>> the oracle 8 detection, its a bit redundant to require it manually.
>> 
>> On May 18, 2010, at 1:29 PM, Kent wrote:
>> 
>> 
>> 
>>> There is a fairly short Oracle-published white paper on Unicode
>>> support 
>>> here:http://www.oracle.com/technology/tech/globalization/pdf/TWP_AppDev_Un...
>> 
>>> It does state that starting with Oracle7 there was Unicode support and
>>> lists a table of Oracle version, Character set and Unicode version.
>>> It also states you can *not* store Unicode in the NCHAR datatype until
>>> Oracle 9i.
>> 
>>> On May 18, 1:23 pm, Kent Bower <k...@retailarchitects.com> wrote:
>>>> No, this is what was causing "ORA-12704: character set mismatch":
>> 
>>>> SQL> SELECT CAST('test unicode returns' AS NVARCHAR2(60)) AS anon_1 FROM
>>>> DUAL;
>>>> SELECT CAST('test unicode returns' AS NVARCHAR2(60)) AS anon_1 FROM DUAL
>>>>              *
>>>> ERROR at line 1:
>>>> ORA-12704: character set mismatch
>> 
>>>> On 5/18/2010 1:17 PM, Michael Bayer wrote:
>> 
>>>>> Sorry, I meant NVARCHAR2.
>> 
>>>>> SELECT CAST('test unicode returns' AS NVARCHAR2(60)) AS anon_1 FROM DUAL
>> 
>>>>> works ?  or no ?
>> 
>>>>> On May 18, 2010, at 12:17 PM, Kent wrote:
>> 
>>>>>> Oops, my bad, I didn't notice you that statement changed NVARCHAR2 to
>>>>>> NVARCHAR:
>> 
>>>>>> Here is that result:
>>>>>> =============================
>>>>>> SQL>  SELECT CAST('test unicode returns' AS NVARCHAR(60)) AS anon_1
>>>>>> FROM DUAL
>>>>>>   2  ;
>>>>>> SELECT CAST('test unicode returns' AS NVARCHAR(60)) AS anon_1 FROM
>>>>>> DUAL
>>>>>>                                               *
>>>>>> ERROR at line 1:
>>>>>> ORA-00907: missing right parenthesis
>>>>>> =============================
>> 
>>>>>> On May 18, 12:15 pm, Kent<k...@retailarchitects.com>  wrote:
>> 
>>>>>>>> SELECT CAST('test unicode returns' AS NVARCHAR(60)) AS anon_1 FROM DUAL
>> 
>>>>>>>> then it seems like either that fails directly, or it fails when the 
>>>>>>>> client gets a hold of it.   See what happens with that statement.   
>>>>>>>> Not sure that Oracle 8 has NVARCHAR which might be the issue.
>> 
>>>>>>> Please see the beginning of my previous post, that is the statement
>>>>>>> creating the "ORA-12704: character set mismatch"
>> 
>>>>>>> So, you intend to change exc.DBAPIError to Exception? (That is
>>>>>>> actually exactly what I had just done as a workaround until I heard
>>>>>>> back from you)
>> 
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "sqlalchemy" group.
>>>>>>> To post to this group, send email to sqlalch...@googlegroups.com.
>>>>>>> To unsubscribe from this group, send email to 
>>>>>>> sqlalchemy+unsubscr...@googlegroups.com.
>>>>>>> For more options, visit this group 
>>>>>>> athttp://groups.google.com/group/sqlalchemy?hl=en.
>> 
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "sqlalchemy" group.
>>>>>> To post to this group, send email to sqlalch...@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to 
>>>>>> sqlalchemy+unsubscr...@googlegroups.com.
>>>>>> For more options, visit this group 
>>>>>> athttp://groups.google.com/group/sqlalchemy?hl=en.
>> 
>>>> --
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "sqlalchemy" group.
>>>> To post to this group, send email to sqlalch...@googlegroups.com.
>>>> To unsubscribe from this group, send email to 
>>>> sqlalchemy+unsubscr...@googlegroups.com.
>>>> For more options, visit this group 
>>>> athttp://groups.google.com/group/sqlalchemy?hl=en.
>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "sqlalchemy" group.
>>> To post to this group, send email to sqlalch...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> sqlalchemy+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/sqlalchemy?hl=en.
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To post to this group, send email to sqlalch...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> sqlalchemy+unsubscr...@googlegroups.com.
>> For more options, visit this group 
>> athttp://groups.google.com/group/sqlalchemy?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
> 

Attachment: ora8_unicode.patch
Description: Binary data

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to