[Dbix-class] Using DBIx::Class with linked databases in Oracle

Amelia Ireland aireland at lbl.gov
Sat Jun 20 17:49:21 GMT 2015


To answer my own question here, I was getting weird SQL generated when the
table name had the link in it; "linked_table\@linked_db" was corrupted into
"lnkdtbl at lnkddb_M38DWUJS" (or something similar). I tried removing the
"@linked_db" part from the DBIx::Class table name, and miraculously, it
worked! It seems that although DBIx::Class::Schema::Loader doesn't process
linked tables, DBIx::Class is able to use them transparently. Great!



On 19 June 2015 at 17:29, Amelia Ireland <aireland at lbl.gov> wrote:

> I'm querying an Oracle database with a number of linked tables and have
> not yet been able to access the linked tables using DBIx::Class.
>
> I generated the schema for both databases using DBIC::Schema::Loader
> separately as DBIC::Schema::Loader doesn't follow links.
>
> I'm now trying to translate a nested select query into a DBIx::Class data
> structure and wrestle with the linked DB issue.
>
> SELECT name, id
> FROM local_table
> WHERE alt_table_id
> IN (
>     SELECT  link_id
>     FROM linked_table\@linked_db
> )
>
> Is there any way to get DBICSL to acknowledge the linked tables when
> creating the schema, and if not, how can I use DBIx::Class to perform the
> nested select query?
>
> Any help would be gratefully received.
>
> Thank you!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20150620/bb6982c9/attachment.htm>


More information about the DBIx-Class mailing list