Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Insert without telling column names
On Tue, 20 Mar 2001 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
>
Roland,
You can omit column names only if you are inserting into all columns of the table, in the same order that they appear in the data dictionary.
e.g.
create table mytab ( col1 number, col2 date, col3 number);
valid: insert into mytab values(1, sysdate, 2);
invalid: insert into mytab values( 1, sysdate );
ERROR at line 1:
ORA-00947: not enough values
invalid: insert into mytab values( 1,2,sysdate);
ERROR at line 1:
ORA-00932: inconsistent datatypes
Jared
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: jkstill_at_cybcon.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 - 11:19:18 CST
![]() |
![]() |