i have that error and i dont know how to handle it in SQl
ORA-02291: integrity constraint
(SQL_VDITXCARYSZTRVANRYJTGPHNZ.SYS_C0087921839) violated - parent
key not found ORA-06512: at "SYS.DBMS_SQL", line 1721
CREATE TABLE ticket(
ticket_no numeric(10) primary key,
booking_date date not null,
ticket_tybe varchar2(50) not null,
price numeric(10)not null,
flight_id varchar2(10)not null,
passenger_id numeric(10)not null,
foreign KEY (flight_id) references flight(flight_id),
foreign KEY (passenger_id) references
passenger(passenger_id));
desc ticket;
CREATE TABLE ticket_tax(
tax numeric(10) not null,
ticket_no numeric(10) not null,
foreign KEY (ticket_no) references ticket(ticket_no),
primary key(tax,ticket_no));
desc ticket_tax;
INSERT INTO ticket_tax
(tax , ticket_no )
VALUES
(90 , 0001 );
INSERT INTO ticket_tax
(tax , ticket_no )
VALUES
(195 , 0002 );
INSERT INTO ticket_tax
(tax , ticket_no )
VALUES
(90 , 0003 );
INSERT INTO ticket_tax
(tax , ticket_no )
VALUES
(195 , 0004 );
INSERT INTO ticket_tax
(tax , ticket_no )
VALUES
(90, 0005 );
i have that error and i dont know how to handle it in SQl ORA-02291: integrity constraint (SQL_VDITXCARYSZTRVANRYJTGPHNZ
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am