So "SELECT ID, NAME FROM CUSTOMER" becomes "SELECT ID, NAME FROM
USERNAME.CUSTOMER"
I noticed that SQL_ATTR_CURRENT_SCHEMA is set to the username in
ibm_db_dbi.py, but even if I hard-code my schema, it still uses my
username.
What you want to do actually, please specify more clearly.
By default current schema is username, In dbi programming you can
change current schema by “set_current_schema()” method.
Thanks,
Rahul Priyadarshi
There are some workaround available in Django.
For e.g.
1)http://code.djangoproject.com/ticket/6064 is one which already
available, but to use this workaround there is some modification
needed in base.py of ibm_db_django apator. You can pick up modified
base.py from http://groups.google.com/group/ibm_db/web/base.py and
replace your existing base.py(at location '../site-packages/
ibm_db_django-0.2.0-py2.5.egg/ibm_db_django/') to this one.
2) http://code.djangoproject.com/ticket/6148 seems a more fuller
solution but not yet made it in.
3) Through model meta options you can set db_table metadata to
'”schema”.”table_name”'
<<<<
>I noticed that SQL_ATTR_CURRENT_SCHEMA is set to the username in
>ibm_db_dbi.py, but even if I hard-code my schema, it still uses my
>username.
<<<<
There is no need of setting SQL_ATTR_CURRENT_SCHEMA to username at
the time of creating connection . We will remove this from our next
release.
If you need any further clarifications or help then feel free to ask
me.
Thanks,
Rahul Priyadarshi