Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Inserting a Record into a Table
hi,
try
INSERT INTO yournewtable
SELECT * FROM youroldtable;
if you want to modify value for particular field you can use oracle functions in SELECT clause.
in example below I use string function called SUBSTR :
SQL> insert into newdept
2 select deptno,SUBSTR(dname,1,3) ,loc from olddept;
SQL> select * from olddept;
DEPTNO DNAME LOC
DEPTNO DNA LOC
<> Bambang Setiawan <>
>>> kgel_at_ppoone.com 08/03/01 06:50 >>>
Can you insert an entire record into a table without having to specify each
individual field ??
I need to copy multiple rows in a table after I have modified its key. I do not want to have to specify each field. Is there a way just to select the record, modify the particular field, and then insert the record... WITHOUT having to list all the fields or each individual value ??
Thanks
Kevin
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: kgel_at_ppoone.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bambang Setiawan INET: Bambang.Setiawan_at_Sidola.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Aug 03 2001 - 13:38:25 CDT
![]() |
![]() |