On Sun, 23 Jan 2011 20:49:58 +0100, Jorge Gonzalez
<[email protected]> wrote:
> But whenever I try to use the schema classes, they don't work and give 
> exceptions about 'table my_table_name does not exist in current schema'. 
> I believe this is due to the table name being specified as 
> 'my_table_name', and not 'OWNER.my_table_name' in the '...->table(' 
> function call, since I have manually modified the class to be like the 
> latter, and it works this way.
> 
> I'd like to know where can I put the equivalent "db_schema=OWNER" or 
> equivalent option, so that all the schema classes use the tables from 
> the OWNER schema, despite connecting to the database with the READER
user.

I had a similar problem with DB2. I use the following after connecting to
the database in on_connect(): 

my $rc = $db_schema->storage->dbh_do(
                sub {
                    my ($storage, $dbh, $dbowner) = @_;
                    $dbh->do("SET CURRENT SQLID='$dbowner'");
                },
                $dbowner
            );

Maybe this helps as Oracle might have a similar construct.

regards
    Joerg

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to