Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Creating remote table thru a DB Link

Re: Creating remote table thru a DB Link

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: 29 Apr 2006 05:43:25 -0700
Message-ID: <1146314604.960094.102880@j33g2000cwa.googlegroups.com>


Dan,

you can

create table xxx as select from xxx_at_remote;

but you can't

create table xxx_at_remote as select from xxx;

The difference is obvious. You have a few ways around this, but they require that you create a dblink on remote server back to the source server. You can then log into the remote db and ctas * from xxx_at_source or you can create a stored procedure like this:

procedure copy_table
is
begin
  execute immediate 'create table xxx as select * from xxx_at_source'; end copy_table;

and then run it from source db:

SQL> exec copy_table_at_remote

Hth,

    Vladimir M. Zakharychev
    N-Networks, makers of Dynamic PSP(tm)     http://www.dynamicpsp.com Received on Sat Apr 29 2006 - 07:43:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US