Hello Michael,

thanks for the answer, thanks for sqlalchemy and thanks for the link.

Finally indeed we installed all packages via pip and at least the option
problem was gone.

Unfortunately we experience another problem.
Our model specification contains several sqlalchemy.types.UnicodeText()
columns.
They worked fine under mysql, postgres and sqlite, but we are
experiencing the (logical) problem with oracle.  (Now it is getting
hard, since I am not the oracle expert).

So the tables get created with the columns -- specified as UnicodeText
in the model -- as CLOB/NCLOB on oracle. Ok, that's the way it is
described here
http://docs.sqlalchemy.org/en/latest/core/types.html#sql-standard-types.

But this leads to an uncomfortable behaviour: since the behaviour with a
mysql or postgres backend will be different to that of the oracle
backend. While our application is able to search, sort and filter
(where) those columns in mysql and postgres it will fail with oracle as
a backend, since in oracle NCLOBs can not be searched, filtered or
sorted, and we get the error message: inconsistent datatypes: expected -
got NCLOB.

What I am aiming at is: an application with sqlalchemy will behave
differently if the backend is either mysql (will work) or oracle (will
break).
Should the mapping of the unicodetext to the column data type have same
effects on different databases?
Bad thing: to my understanding oracle provides no unlimited searchable
string/character data type.


Kind regards
Cornelius



Am 26.04.2012 22:00, schrieb Michael Bayer:
> "option" as a reserved word was added at least at the very beginning
> of 0.6.
>
> I'd advise upgrading, and Redhat shouldn't be at play here since you
> really shouldn't use distribution packages for Python libraries,
> there's a great discussion of this the other day at this post:
> http://hynek.me/articles/python-deployment-anti-patterns/ .
>
>
>
> On Apr 26, 2012, at 9:15 AM, Cornelius Kölbel wrote:
>
> > Dear list,
>
> > I defined a table with a column, that is called "option".
> > I got a redhat 5 system with sqlalchemy 0.5.5.
> > When I try to do a
> >   paster setup-app
>
> > the machine tries to create the table which contains columns "default"
> > and "option", but it breaks with an ORA error "invalid identifier".
>
> > It seems like this: "option" is a keyword in Oracle, and it does not get
> > enclosed in quotes.
> > I see that the other column "columnd" is enclosed in quotes. Obviously
> > sqlalchemy knows the keyword "default" and puts in in quotes. But it
> > does not seem to know the keyword "option" and does not put it in
> quotes.
>
> > I think in newer versions this was fixed. Do you know in which version
> > of sqlalchemy started to see "option" as keyword?
>
> > Kind regards
> > Cornelius
>


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to