Eaddy Barnes
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could just insert nulls for the cols that dont have values
insert into table values(col1,col2,col3,col4 ,col5,col6 ,null,null )
insert into table values(col1,col2,col3,col4
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>,<C OL5>,<COL6 >) VALUES( <VALUE1>, <VALUE2>, <VALUE3>, <VALUE4>, <VALUE5>, <VALUE6>);
INSERT INTO <YOUR TABLE NAME> VALUES( <VALUE1>, <VALUE2>, <VALUE3>, <VALUE4>, <VALUE5>, <VALUE6>, NULL,NULL);
OR
INSERT INTO <YOUR TABLE NAME>(<COL1>,<COL2>,<COL3>
insert into yourtable
(First_name,
Last_name,
Street,
Zip_code,
State,
Home_Phone)
values
('John', 'Doe', '123 Main St.','20000','NY','555-121 2');
OR -
insert into yourtable values
('John', 'Doe', '123 Main St.','20000','NY','555-121 2',null,nu ll);
(First_name,
Last_name,
Street,
Zip_code,
State,
Home_Phone)
values
('John', 'Doe', '123 Main St.','20000','NY','555-121
OR -
insert into yourtable values
('John', 'Doe', '123 Main St.','20000','NY','555-121
you can set default values for those columns too
ASKER
The columns are null theres no "NOT NULL" constraints implemented.