Link to home
Start Free TrialLog in
Avatar of Eaddy Barnes
Eaddy BarnesFlag for United States of America

asked on

ORA-00947 Not Enough Values

Hey Dudes,

I have a Table which contains 19 fields. Now i have some values that i want to insert BUT the total number of values equal exactly 13. Now my question is, is there a way that i can still get the values into the necessary fields and for those fields that dont have any values they just gets overlooked?

e.g
First_name
Last_name
Street
Zip_code
State
Home_Phone
Mobile_Phone
Other_phone

Now for instance i have fields 1 - 6 but not 7 and 8. is there a way i can still get to insert the values from 1 - 6 and since i dont have anything for 7 & 8 they get skipped?

Thx

ASKER CERTIFIED SOLUTION
Avatar of paquicuba
paquicuba
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eaddy Barnes

ASKER

WOW, you are a scary fellow, lol
The columns are null theres no "NOT NULL" constraints implemented.
You could just insert nulls for the cols that dont have values

insert into table values(col1,col2,col3,col4,col5,col6,null,null)
Then, follow the examples, either put NULLs or list the columns.

INSERT INTO <YOUR TABLE NAME> VALUES( <VALUE1>, <VALUE2>, <VALUE3>, <VALUE4>, <VALUE5>, <VALUE6>, NULL,NULL);

OR

INSERT INTO <YOUR TABLE NAME>(<COL1>,<COL2>,<COL3>,<COL4>,<COL5>,<COL6>) VALUES( <VALUE1>, <VALUE2>, <VALUE3>, <VALUE4>, <VALUE5>, <VALUE6>);
Avatar of awking00
insert into yourtable
(First_name,
Last_name,
Street,
Zip_code,
State,
Home_Phone)
values
('John', 'Doe', '123 Main St.','20000','NY','555-1212');
OR -
insert into yourtable values
('John', 'Doe', '123 Main St.','20000','NY','555-1212',null,null);


you can set default values for those columns too