Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Looking for a more readable INSERT sytax

martin75Nov 15 2007 — edited Nov 15 2007

I am going to insert into a table which has 160 Columns. For a testing purpose I only have to insert values to 24 columns. Now i have to type all the 160 Columns and enter the corresponding values like the one below. This leads to mistakes all the time as i might be entering a wrong value for a column due to poor readability.

insert into DEL_DATE_PROCESS
  (ORD_ID,
   WHSE_CTRL_NBR,
   WHSE_CODE,
   CO,
   DIV,
   SEC_NBR,
   SEC_SFX,
   ORD_NBR,
   ORD_SFX,
   ORD_TYPE,
   SHIPTO,
   SHIPTO_NAME,
   .
   .
   .
   .
   160th Column_name)
   values
   ((7201,
   '491844',
   'SH1',
   'SPL',
   'SPL',
   null,
   .
   .
   .
   .
   160th Column Value)
   

Is there a more readable INSERT syntax wherein i could type the column value next to the column name like the one below (Column values in Bold).

   insert into DEL_DATE_PROCESS
    VALUES  (ORD_ID 7201,
    WHSE_CTRL_NBR 491844,
    WHSE_CODE 'SH1',
    CO 'SPL',
    DIV 'SPL-DEV',
    SEC_NBR 8893,
    .
    .
    .
    )
    

Eventhough a syntax like the following works, it is still not readable when it comes to 24 columns.

    INSERT INTO EMP(empno,ename,mgr) values (887,'john',7);
    
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2007
Added on Nov 15 2007
6 comments
436 views