![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
This code will cause the error because there are 3 columns in the table: INSERT INTO dept VALUES (88, 'Programming'); ORA-00947: not enough values This code will work. Here you specify only the columns you want to insert: INSERT INTO dept (deptno, dname) VALUES (88, 'Programming'); 1 row inserted |
#4
| |||
| |||
|
|
"Emad-ud-deen Richard Leiman & Eva Fithria Leiman" <a@a.com> wrote in message news:djQWb.34065$Kh3.442 (AT) newssvr33 (DOT) news.prodigy.com... This code will cause the error because there are 3 columns in the table: INSERT INTO dept VALUES (88, 'Programming'); ORA-00947: not enough values This code will work. Here you specify only the columns you want to insert: INSERT INTO dept (deptno, dname) VALUES (88, 'Programming'); 1 row inserted I would recommend to NEVER use insert-statements like the first example, for exactly for the reason the OP has encountered. In my current job, we won't let code like that pass the QA/code review. In a real-world situation, the chance that your table will at some time have columns added, removed, of even just switched will almost equal 1. Theo |
![]() |
| Thread Tools | |
| Display Modes | |
| |