This discussion is archived
7 Replies Latest reply: Nov 23, 2012 5:05 AM by veejays_user10302525-Oracle RSS

update entire table

Roger25 Explorer
Currently Being Moderated
Hi,
If i have a table, my_table, with 20 columns, and i have something like:
declare 
...
begin
  for r in (select * from my_table) loop
    insert into my_table (...) values (...)
  end loop;
end;
/
So the code is not so clear but only to understand the idea.. so i want to insert a row into that table, with values for all columns being those returned by the for loop, but without a column (i'm giving the value for that column).
For example, the first 19 rows should contain the values from the currently record in 'for.. loop', and the last column to contain a static value.
Is it possible to do this, without specifying in the 'values' clause, something like (r.col1, r.col2, .... r.col19, 'G')? meaning other insert method (maybe for a better performance)

Thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points