[PonyORM-list] Oracle tablenames.

Bjarni Hákonarson bjarni at prentvorur.is
Mon Jul 28 11:17:53 UTC 2014


Hi all,

and thank you authors for a great product.

I come from a oracle-database background and I am relatively new to python
and an absolute infant in pony.orm

I am now in the midst of creating an application that uses existing Oracle
database schema. I have been playing around with pony.orm and I think it
would save me a ton of work if I could use that. I have already tested it
towards a seperate schema and having it to create it own tables and
everything works just great. However when I a ran it against a copy of the
original schema it complaints it cannot find TABLE_SITE table.

The problem is that pony.orm forces tablenames to lowercase. That in itself
would be fine except that also forces you to use parenthesis around
tablenames in Oracle queries.

(see:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements008.htm)

The results are like this: (actual names changed)

SQL> select * from tab;

TNAME       TABTYPE CLUSTERID
------------------------------ ------- ----------
CUSTOMERS_SITE       TABLE
customers       TABLE
persons        TABLE
readings       TABLE

SQL> select name from customers;
select name from customers
                 *
ERROR at line 1:
ORA-00942: table or view does not exist

Of course using "select name from "customers"; would work fine. The problem
is that it would mean code-change in other applications using the same
schema and that doesn't work. An older application accessing the pony.orm
created schema results in:

  File
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py",
line 512, in reflecttable
    raise exc.NoSuchTableError(table.name)
sqlalchemy.exc.NoSuchTableError: sites


Is there any way to override the behaviour of pony.orm when creating tables
for Oracle?

Kind regards,
Bjarni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20140728/3304cf8d/attachment.html>


More information about the ponyorm-list mailing list