The quoting trick worked well. Thank You

Chris 
 
>>> Ian <ian.g.ke...@gmail.com> 10/20/10 2:48 PM >>> 
On Oct 20, 8:20 am, "Christopher Conover" <cono...@mail.ucf.edu>
wrote:
> Hello,
>
> I am using Django's multiple database support to connect to an existing 
> Oracle database (10g). I do not have control of the schema nor do I have any 
> other privileges beyond SELECT. Further, the tables and views that I have 
> access to are owned by a different user. Because of this I'm having to refer 
> to these tables in queries using the other_user.table syntax.
>
> This issue is that Django's Oracle backend wants to quote all table names. 
> This does not work for the other_user.table syntax. To get this working for 
> the moment, I have patched the quote_name method on line 192 of 
> django/db/backends/oracle/base.py to forego the quoting.
>
> Does anyone have any suggestions of how to work around this without modifying 
> the Django source?

Alternate schema support is the subject of ticket #6148 in the Django
ticket tracker.  When that finally lands, it will be as simple as
setting the db_schema Meta option.

In the meantime, the recommended workaround for Oracle is to create
synonyms within the Django schema for the external tables and views,
e.g.:

CREATE SYNONYM MY_SCHEMA.SOME_TABLE FOR OTHER_SCHEMA.SOME_TABLE;

This only requires the rather innocuous CREATE SYNONYM system
privilege.  If the DBA won't even let you have that, you can fall back
on specifying the schema and table in the db_table option with the
proper interior quoting, e.g.:

db_table = 'other_schema"."some_table'

This is sufficient to trick Django into doing the right thing in most
cases.

Cheers,
Ian

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


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

Reply via email to