Subject: | Oracle loader can't get unique constraints unless you own the schema |
I'm trying to bootstrap from an Oracle database, and the ::DBI::Oracle
loader is giving me issues as I don't own the schema the tables are in.
I managed to get it working to get most of the table definition, by using:
on_connect_do => [ "alter session set current_schema=REP" ]
However, the method _table_uniq_info uses this query to get contraints:
SELECT constraint_name, ucc.column_name
FROM user_constraints JOIN user_cons_columns ucc USING (constraint_name)
WHERE ucc.table_name=? AND constraint_type='U'
ORDER BY ucc.position
This fails for me because I don't own the tables, so selecting from
user_* never returns anything. This query should be s/user_/all_/g
(using all_ instead of user_ returns all the data the user has access
to, rather than all the data they own).
--
www.jasonkohles.com