Re: copy table to another schema programatically

From: <mh_at_pixar.com>
Date: Sun, 20 Jan 2008 21:19:05 GMT
Message-ID: <dVOkj.4328$jJ5.462@newssvr11.news.prodigy.net>


DA Morgan <damorgan_at_psoug.org> wrote:
> Sean Nakasone wrote:
> > anyone have code snippets that copy a table from one schema to another?
> > i usually use toad to do this but i really would like to find more
> > automated way.
>
> CREATE TABLE new_table AS
> SELECT * FROM schema_name.existing_table;

If we wanted to do this with several tables, would we have any issues with relationship integrity? I.e., if we do several create tables in a transaction, will the tables be consistent?

create table1 from other.table1;
(other.table1, other.table2 updated by other people) create table2 from other.table2;
commit;

Many TIA!
Mark

-- 
Mark Harrison
Pixar Animation Studios
Received on Sun Jan 20 2008 - 15:19:05 CST

Original text of this message