Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT INTO (SELECT ....... Problems

Status
Not open for further replies.

notrut

Programmer
Joined
Feb 6, 2002
Messages
87
Location
CA
Hi,

I'm trying to do an insert using a select statement for an Oracle database.

I want to copy a set of records from the same table but with different values for some of the fields. (i.e. different dates)

Is this possible without having to insert each record separately???

 
Absolutely. An example would be a two column table (col1, last_update) where you select col1 from another table, but set last_update to the current date. You insert would look like

insert into your_table (select col1, sysdate from another_table);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top