誰かがこれで私を助けることができるのだろうか. SQLですべてを実行しましたが、次のエラーが表示されます:
エラー レポート: SQL エラー: ORA-00001: 一意の制約 (GAMES.ATHLETE_PK) が 00001 に違反しました。Trusted Oracle が DBMS MAC モードで構成されている場合、異なるレベルに重複するエントリが存在すると、このメッセージが表示されることがあります。*処置: 一意の制限を削除するか、キーを挿入しないでください。
1 回のトランザクションですべてのレコードを一度に挿入したい。また、シーケンスを使用して新しい主キーを生成します。1つずつ挿入してみましたが大丈夫です。しかし、一度にすべて挿入すると、これはエラーです...
INSERT ALL
INTO athlete (athlete_no, athlete_name, athlete_birthdate, athlete_birthplace, athlete_born_country, athlete_gender, athlete_height, athlete_weight, athlete_team_country)
VALUES (athlete_no_seq.nextval, 'Michael Phelps', to_date('1985-06-30','yyyy-mm-dd'), 'Towson', 'USA', 'M', 193, 88, 'USA')
INTO athlete (athlete_no, athlete_name, athlete_birthdate, athlete_birthplace, athlete_born_country, athlete_gender, athlete_height, athlete_weight, athlete_team_country)
VALUES (athlete_no_seq.nextval, 'Stephanie Rice', to_date('1988-06-17','yyyy-mm-dd'), 'Brisbane', 'AUS', 'F', 176, 67, 'AUS')
INTO athlete (athlete_no, athlete_name, athlete_birthdate, athlete_birthplace, athlete_born_country, athlete_gender, athlete_height, athlete_weight, athlete_team_country)
VALUES (athlete_no_seq.nextval, 'Rebecca Adlington', to_date('1989-02-17','yyyy-mm-dd'), 'Mansfield', 'GBR', 'F', 179, 870, 'GBR')
INTO athlete (athlete_no, athlete_name, athlete_birthdate, athlete_birthplace, athlete_born_country, athlete_gender, athlete_height, athlete_weight, athlete_team_country)
VALUES (athlete_no_seq.nextval, 'Lee Chong Wei', to_date('1982-10-21','yyyy-mm-dd'), 'Perak', 'MAS', 'M', 170, 60, 'MAS')
INTO athlete (athlete_no, athlete_name, athlete_birthdate, athlete_birthplace, athlete_born_country, athlete_gender, athlete_height, athlete_weight, athlete_team_country)
VALUES (athlete_no_seq.nextval, 'Lin Dan', to_date('1983-10-14','yyyy-mm-dd'), 'Fujian', 'CHN', 'M', 176, 68, 'CHN')
INTO athlete (athlete_no, athlete_name, athlete_birthdate, athlete_birthplace, athlete_born_country, athlete_gender, athlete_height, athlete_weight, athlete_team_country)
VALUES (athlete_no_seq.nextval, 'Peter Gade', to_date('1976-12-14','yyyy-mm-dd'), 'Aalborg', 'DEN', 'M', 183, 73, 'DEN')
INTO competes (athlete_no, discipline_code, sg_gameno)
VALUES (athlete_no_seq.currval, (SELECT discipline_code FROM discipline where discipline_name = 'Swimming'), 30)
INTO competes (athlete_no, discipline_code, sg_gameno)
VALUES (athlete_no_seq.currval, (SELECT discipline_code FROM discipline where discipline_name = 'Swimming'), 30)
INTO competes (athlete_no, discipline_code, sg_gameno)
VALUES (athlete_no_seq.currval, (SELECT discipline_code FROM discipline where discipline_name = 'Swimming'), 30)
INTO competes (athlete_no, discipline_code, sg_gameno)
VALUES (athlete_no_seq.currval, (SELECT discipline_code FROM discipline where discipline_name = 'Swimming'), 30)
INTO competes (athlete_no, discipline_code, sg_gameno)
VALUES (athlete_no_seq.currval, (SELECT discipline_code FROM discipline where discipline_name = 'Swimming'), 30)
INTO competes (athlete_no, discipline_code, sg_gameno)
VALUES (athlete_no_seq.currval, (SELECT discipline_code FROM discipline where discipline_name = 'Swimming'), 30)
INTO venue(venue_no, venue_name, venue_location, venue_usedfrom, venueused_to, venue_seatingcapacity, venue_structure, venue_use)
VALUES(venue_no_seq.nextval, 'Aquatics Centre', 'Olympics Park, East London', to_date('2012-07-28','yyyy-mm-dd'), to_date('2012-10-08','yyyy-mm-dd'), 17500, 'N', 'P')
INTO venue(venue_no, venue_name, venue_location, venue_usedfrom, venueused_to, venue_seatingcapacity, venue_structure, venue_use)
VALUES(venue_no_seq.nextval, 'Wembley Arena', 'North West London', to_date('2012-07-28','yyyy-,mm-dd'), to_date('2012-08-05','yyyy-mm-dd'), 6000, 'E', 'P')
SELECT * FROM dual;
commit;