Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Insert without telling column names
You are misinformed. If you have a table of the form
col1 varchar2(1)
col2 number
col3 date
You can insert into it with the insert statement INSERT INTO MYTABLE VALUES('X',23,SYSDATE); As long as ALL the columns are included in the values clause in the order they were created in the table, you don't have to define the column names.
>>> dbarbour_at_nucentrix.net 03/20/01 11:36AM >>> Roland,
You can't. There are a number of ways to really cut down on the code required to do an insert, but if you think about it, how will Oracle know where the data is supposed to go if you don't give it the column name(at some point)?
If you're using 8i, there is a direct load insert, but as far as I'm aware, this will work only for a select * from another table.
Dynamic SQL works pretty well for this kind of stuff. What are you trying to do?
Regards,
David A. Barbour
Oracle DBA
Formerly with the now defunct and bankrupt ConnectSouth
Roland.Skoldblom_at_ica.se wrote:
>
> Hallo,
>
> How can I create an insert statement without telling all the names of the columns?
> Give an example, please.
>
> Roland Sköldblom
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: Roland.Skoldblom_at_ica.se
>
> 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: David A. Barbour INET: dbarbour_at_nucentrix.net 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: William Beilstein INET: BeilstWH_at_obg.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 Tue Mar 20 2001 - 13:23:58 CST
![]() |
![]() |