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: Anthony Hogan <ahogan-nospam-_at_iespana.es>
Date: Tue, 29 Apr 2003 08:30:37 +0100
Message-ID: <3EAE2A1D.15D089AD@iespana.es>


Rainer Nonk wrote:
>
> 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 ;-)
>
> thank you,
> Rainer

Rainer,
You need to specify the columns in the syntax and simply add SYSDATE to the select part.

i.e.
insert into table_arch select col1, col2,....,sysdate from table_runtime;

regards
Anthony Hogan Received on Tue Apr 29 2003 - 02:30:37 CDT

Original text of this message

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