Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: insert into ... select *

Re: insert into ... select *

From: Stephan Bressler <stephan.bressler_at_siemens.com>
Date: Tue, 29 Apr 2003 09:03:32 +0200
Message-ID: <b8l814$k6v$1@news.mch.sbs.de>

"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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US