Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: insert into ... select *
"Rainer Nonk" <gora_at_gmx.net> wrote in message
news:3EAE1A4C.6F9FA71D_at_gmx.net...
> Hi,
>
> I would like to extend the following statement:
> insert into table_arch select * from table_runtime where order_number =
> 'abc';
>
> table_arch got a new field (a date field, with a creation timestamp). So
> it has one field more than table_runtime. The problem is: i don't have
> any idea how to fill this additional field within one statement. Could
> you give me a hint how the new statement should look like ?
>
> (And: i know how to get the current date: select sysdate from dual ;-)
Hi,
if the new field is the first or last column, things are quite easy (new
column is the first one):
insert into table_arch select sysdate now, a.* from table_runtime a where
order_number ='abc';
If the new field is somewhere in between you would need to name the entire column list
Stephan Received on Tue Apr 29 2003 - 02:03:32 CDT