so i have this code with simple two tables 1-GGroup 2-TimeTable
and this is the code for them :
CREATE TABLE GGroup(
ClassRoom varchar(7),
GroupNum number(5),
C_Code varchar(6),
C_Name varchar(35), Field
Teacher varchar(30),
primary key (ClassRoom)
);
CREATE TABLE TimeTable(
ClassRoom varchar(7),
StudentID number(9),
FirstName varchar(30),
LastName varchar(30),
primary key(ClassRoom, StudentID),
foreign key(ClassRoom) references GGroup(ClassRoom)
);
And i already inserted rows in table GGroup with np!
But now im trying to insert this row
insert into GGroup values (
'A/3/54',
1608,
'ISM223',
'Data Warehouse & Data Mining',
'Dr. Yasser Al-Mshhor'
);
And i got this error:
ORA-00001: unique constraint (SQL_XAKKMDKZQBPBDDQFTDEXENGDH.SYS_C0025290829) violated ORA-06512: at "SYS.DBMS_SQL", line 1721
I think its because this row I inserted before:
insert into GGroup values (
'A/3/54',
1608,
'ISM223',
'Data Warehouse & Data Mining',
'Dr. Yasser Al-Mshhor'
);
How i can fix this ? I dont know alot about sql
GGroup
doesn't look right. But you haven't explained your data, what you are trying to represent, or given sample data, so it is hard to make constructive suggestions. - Gordon Linoff'A/3/54'
in the table. Why do you want to have two or more of them? Seems like your data model is wrong or your application logic is wrong. - APC