Davide Alberani wrote:
> So... yes, it's probably a good idea to let the ibm_db developers know
> of this behavior.
I just send a message to their mailing list.
> What if (just to do a fast test) you change this line of the
> setConnection function:
> params = {'encoding': encoding}
>
> to this one:
> params = {'encoding': encoding, 'convert_unicode': True}
>
> does it works?
It does, great! :-) Thanks!
I found another issue regarding the use of schemas: I want to create all
IMDB stuff (tables, indexes, ...) in a separate schema of my database.
Therefore, I pass the schema name within the connection URI:
ibm_db_sa://user:[EMAIL PROTECTED]:port/db;CurrentSchema=schema
If I do not specify a schema, imdbpy2sql.py works but creates all stuff
within the database user's default schema, which is not what I want.
But when passing the schema information as in the above URI (schema name
is "imdb"), I get this output:
=====================================================
RUNNING imdbpy2sql.py
SAVING imdbID values for movies... SKIPPING: no data.
SAVING imdbID values for people... SKIPPING: no data.
SAVING imdbID values for characters... SKIPPING: no data.
SAVING imdbID values for companies... SKIPPING: no data.
DROPPING current database...
Traceback (most recent call last):
File "/home/selke/Desktop/imdb/IMDbPY/usr/bin/imdbpy2sql.py", line
2145, in <module>
run()
File "/home/selke/Desktop/imdb/IMDbPY/usr/bin/imdbpy2sql.py", line
2000, in run
dropTables(DB_TABLES)
File "/usr/lib64/python2.5/site-packages/imdb/parser/sql/dbschema.py",
line 309, in dropTables
File
"/home/selke/Desktop/imdb/IMDbPY/usr/lib64/python2.5/site-packages/imdb/parser/sql/alchemyadapter.py",
line 277, in dropTable
self.table.drop(checkfirst=checkfirst)
File "/usr/lib/python2.5/site-packages/sqlalchemy/schema.py", line
375, in drop
self.metadata.drop_all(bind=bind, checkfirst=checkfirst, tables=[self])
File "/usr/lib/python2.5/site-packages/sqlalchemy/schema.py", line
1610, in drop_all
bind.drop(self, checkfirst=checkfirst, tables=tables)
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 1144, in drop
self._run_visitor(self.dialect.schemadropper, entity,
connection=connection, **kwargs)
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 1168, in _run_visitor
visitorcallable(self.dialect, conn, **kwargs).traverse(element)
File "/usr/lib/python2.5/site-packages/sqlalchemy/sql/visitors.py",
line 75, in traverse
return self._non_cloned_traversal(obj)
File "/usr/lib/python2.5/site-packages/sqlalchemy/sql/visitors.py",
line 134, in _non_cloned_traversal
self.traverse_single(target)
File "/usr/lib/python2.5/site-packages/sqlalchemy/sql/visitors.py",
line 35, in traverse_single
return meth(obj, **kwargs)
File "/usr/lib/python2.5/site-packages/sqlalchemy/sql/compiler.py",
line 936, in visit_metadata
self.traverse_single(table)
File "/usr/lib/python2.5/site-packages/sqlalchemy/sql/visitors.py",
line 35, in traverse_single
return meth(obj, **kwargs)
File "/usr/lib/python2.5/site-packages/sqlalchemy/sql/compiler.py",
line 963, in visit_table
self.execute()
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 1794, in execute
return self.connection.execute(self.buffer.getvalue())
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 844, in execute
return Connection.executors[c](self, object, multiparams, params)
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 854, in _execute_text
self.__execute_raw(context)
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 916, in __execute_raw
self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 960, in _cursor_execute
self._handle_dbapi_exception(e, statement, parameters, cursor)
File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py",
line 942, in _handle_dbapi_exception
raise exceptions.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
sqlalchemy.exceptions.ProgrammingError: (ProgrammingError)
ibm_db_dbi::ProgrammingError: Statement Execute Failed: [IBM][CLI
Driver][DB2/LINUXX8664] SQL0204N "IMDB.PERSON_INFO" is an undefined
name. SQLSTATE=42704 SQLCODE=-204 '\nDROP TABLE person_info' {}
=====================================================
Any ideas on that? :-)
Thanks,
Joachim
--
M. Sc. Joachim Selke
Technische Universität Braunschweig, Institut für Informationssysteme
Mühlenpfordtstraße 23, 38106 Braunschweig, Germany
<http://www.l3s.uni-hannover.de/~selke>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Imdbpy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel