I keep getting Error report - ORA-01722: invalid number when I'm trying to insert values into my table.
I'm using oracle. The original problem was that the primary key for table store was a foreign key for table employee and vice versa, hence I could not insert any values. So I changed the foreign key in table store to NULL and tried that but still didn't work
create table Store(
Store_ID integer primary key,
Warehouse_ID integer not null,
Employee_ID integer,
Owner_name varchar2 (15) not null,
Store_hours varchar (10) not null,
Store_name varchar (20) not null,
Store_Address varchar2 (35) not null,
CONSTRAINT Warehouse_FK_Store
FOREIGN KEY (Warehouse_ID)
REFERENCES Warehouse (Warehouse_ID),
CONSTRAINT Employee_FK_Store
FOREIGN KEY (Employee_ID)
REFERENCES Employee (Employee_ID));
insert into Store
values (101, 1001, NULL , 'Grant Campbell', '7:00am - 10:00pm', 'Papakura', '331-345 Great South Road, Takanini, Auckland, 2110');
You have problems with the length of the fields. And you should include the columns being inserted.
I don't know what the types are for the referencing keys, but they need to be the same.
This works:
See here.
Here is a version with the foreign key constraints.