Is it possible to insert into a table
using the record loaded from a cursor?
declare
cursor c_cursor is
select a,b,c from table;
begin
for c_rec in c_cursor
loop
insert into new_table (using record???)
end loop;
end;
Thanks,
Paul
Printable View
Is it possible to insert into a table
using the record loaded from a cursor?
declare
cursor c_cursor is
select a,b,c from table;
begin
for c_rec in c_cursor
loop
insert into new_table (using record???)
end loop;
end;
Thanks,
Paul
Yes.
okay...
How do I code it?
Thanks.
declare
cursor c_cursor is
select a,b,c from table;
begin
for c_rec in c_cursor
loop
insert into new_table (a_new, b_new, c_new)
values (c_rec.a,c_rec.v,c_rec.c);
end loop;
end;
/
what I was really after was to not to have to specify each of the value fields.
something like
insert into new_table record;
and have record represent all of the indivual fields.
It's just a pain because some of my cursors contain dozens of fields and it takes awhile to specify each and every field after the values clause.
Thanks for the help.
Paul
No Pain, No Gain.
U can't do it.Quote:
Originally posted by mrpaulwass
what
something like
insert into new_table record;
in INSERT statment u must wrile VALUES and specify LIST of values.
regardless of u use scalar variables or object types or variable arrays..
Thanks...
Lazy programmer, always looking for a shortcut. That's me.
P