Re: querying over multiple database links

From: gazzag <justified_at_jamms.org>
Date: Tue, 5 Jul 2011 09:01:50 -0700 (PDT)
Message-ID: <c10a99ad-8ed9-4798-9227-5dcd2dff116d_at_c41g2000yqm.googlegroups.com>



On Jul 5, 4:01 pm, Krzysztof Cierpisz <ciape..._at_gmail.com> wrote:
> on database remote1 is a table I want to access => table1
> I have a very limited schema/user created on remote2.
>
> remote2 has public database link to remote1, so I can access
> table1_at_dblink_to_remote1
>
> I have another local database db1 with database link to remote2 =>
> _at_dblink_to_remote2
>
> I would like to create a table from remote1 on my local db1.
> I can achieve that with export/import  (giving remote2 credentials).
>
> Is there a better solution for that task?
>
> thanks,
> chris

CREATE TABLE <table_name>
AS SELECT * FROM <table_name>_at_<remote_database>;

HTH
-g Received on Tue Jul 05 2011 - 11:01:50 CDT

Original text of this message