Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Copy record
Sure , bad practice but
insert into table 2 as select * from table1 where rowid=xxx;
Why is it a bad practice? If the two tables were not created in exactly the
same way then the wrong data would get into the wrong columns.
eg
create table1(field1 varchar2(40), field2 varchar2(40));
create table2(field2 varchar2(40), field1 varchar2(40));
will mean the fileds will be juxtaposed.
so it is better to
insert into table2(field1,field2) as select field1,field2 from table1 where
rowid=xxx;
Less prone to breaking.
Jim
"music4" <music4_at_163.net> wrote in message
news:bfnpr7$g9n_at_netnews.proxy.lucent.com...
> Greetings,
>
> I'm not sure if my question is suitable here. Sorry if not.
>
> I have two table with exactly same structure. Now, I want to copy a record
> from one table to the other. I know rowid of the source record, is there a
> simple way to do the copy without caring what fields the table has.
>
> Thanks in advance!
> Evan
>
>
Received on Thu Jul 24 2003 - 00:46:20 CDT
![]() |
![]() |