Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inserting a full records relies on column order?

SamBJan 3 2007 — edited Jan 4 2007
Just wondering how oracle knows which columns to insert into when you tell it to insert a full record into a table.

create table temp1 (id number,cola varchar2(128),colb date);
create table temp2 (id number,colb date,cola varchar2(128));
insert into temp1 values (1,'hi',sysdate);

declare
cursor cur is select * from temp1;
begin
for rec in cur loop
insert into temp2 values rec;
end loop;
end;

The above code fails which tells me it isn't based on column names.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 1 2007
Added on Jan 3 2007
8 comments
1,497 views