At 08:36 AM 3/20/01 -0800, you wrote:
>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)?

Of course you can.  The only caveat is Oracle will assume you are filling 
all the columns in order, therefore you must provide a value for every 
column, ie
For Table T1(firstname, lastname, telephone, fax, email)

insert into T1 values('John','Smith','4849910','','[EMAIL PROTECTED]')

Note the '' in place of a fax number.  I could also have used null.

I never use this method in applications or procedures, of course, because 
then if you change the table definition it no longer works, but for testing 
stuff, or something I'm only going to run once it's a decent shortcut.

>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
>
>[EMAIL PROTECTED] 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: Regina Harter
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to