| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SLQ question
Hi Anders,
I think you have to spell out the values, like so
insert into table_name v1, v2, v3
values (tmp_row.v1, tmp_row.v2, tmp_row.v3);
Another way would be to use a temporary table with the same fields as table_name. Select your single record into temp_table, modify the rows, then insert/select it back into the main table.
Ken
Anders Blaagaard wrote:
> 
> I have a table with more than 100 columns, and a want to make a copy of
> a row, change a few fields, a put it back into the table (without
> changing the original). The idea is this:
> 
> declare
>   tmp_row table_name%rowtype;
> begin
>   select * into tmp_row from table_name where ...
>   tmp_row.field37 := ..
>   tmp_row.field98 := ..
>   insert into table_name values (tmp_row);   -- ILLEGAL
> end;
> 
> Can anyone think of an easy way to do this?
> 
> Anders Blaagaard
> blaa_at_ifad.dk
 
Received on Wed Sep 24 1997 - 00:00:00 CDT
|  |  |