我创建了这张表:
CREATE TABLE diagnosis(
diag_id NUMBER(8),
SCT_CODE CHAR(10),
diag_date DATE NOT NULL,
GP_ID CHAR(5),
PHN CHAR(5),
Rx CHAR(3),
CONSTRAINT diagnosis_PK PRIMARY KEY (diag_id, SCT_CODE),
CONSTRAINT diagnosis_FK4 FOREIGN KEY (SCT_CODE)
REFERENCES symptom (SCT_CODE) ON DELETE CASCADE,
CONSTRAINT diagnosis_FK1 FOREIGN KEY (GP_ID)
REFERENCES GP (GP_ID) ON DELETE CASCADE,
CONSTRAINT diagnosis_FK2 FOREIGN KEY (PHN)
REFERENCES Patient (PHN) ON DELETE CASCADE,
CONSTRAINT diagnosis_FK3 FOREIGN KEY (Rx)
REFERENCES drug (Rx)
ON DELETE CASCADE);
我已经尝试了这两种方法来填充表格,但它不起作用。请帮助我的语法有什么问题
INSERT ALL
INTO DIAGNOSIS VALUES ('10000001', '38341003', '04-APR-12', ‘GP001’, ‘p1001’, ‘Rx1’)
INTO DIAGNOSIS VALUES ('10000002', '423430007', '07-APR-12', ‘GP001’, ‘p1001’, ‘Rx1’)
INTO DIAGNOSIS VALUES ('10000003', '371032004', '05-APR-12', ‘GP002’, ‘p1002’, ‘Rx2’)
INTO DIAGNOSIS VALUES ('10000004', '38341003', '08-APR-12', ‘GP003’, ‘p1003’, ‘Rx1’)
INTO DIAGNOSIS VALUES ('10000005', '73211009', '07-APR-12', ‘GP003’, ‘p1003’, ‘Rx3’)
INTO DIAGNOSIS VALUES ('10000006', '73211009', '06-APR-12', ‘GP004’, ‘p1004’, ‘Rx3’)
INTO DIAGNOSIS VALUES ('10000007', '38341003', '10-APR-12', ‘GP001’, ‘p1005’, ‘Rx1’)
SELECT * FROM DUAL;
/* Populate Diagnosis Table */
INSERT INTO Diagnosis(diag_id, SCT_CODE, diag_date, GP_ID, PHN, Rx)
VALUES ('10000001', ‘38341003’, '04-Apr-12', 'GP001', 'p1001', 'Rx1');
INSERT INTO Diagnosis(diag_id, SCT_CODE, diag_date, GP_ID, PHN, Rx)
VALUES ('10000002', ‘423430007’, '07-Apr-12', 'GP001', 'p1001', 'Rx1');
INSERT INTO Diagnosis(diag_id, SCT_CODE, diag_date, GP_ID, PHN, Rx)
VALUES ('10000003', ‘371032004’, '05-Apr-12', 'GP003', 'p1002', 'Rx2');
INSERT INTO Diagnosis(diag_id, SCT_CODE, diag_date, GP_ID, PHN, Rx)
VALUES ('10000004', ‘38341003’, '08-Apr-12', 'GP003', 'p1003', 'Rx1');
INSERT INTO Diagnosis(diag_id, SCT_CODE, diag_date, GP_ID, PHN, Rx)
VALUES ('10000005’, ‘73211009’, '07-Apr-12', 'GP003', 'p1003', 'Rx3');
INSERT INTO Diagnosis(diag_id, SCT_CODE, diag_date, GP_ID, PHN, Rx)
VALUES ('10000006', ‘73211009’, '06-Apr-12', 'GP004', 'p1004', 'Rx3');
INSERT INTO Diagnosis(diag_id, SCT_CODE, diag_date, GP_ID, PHN, Rx)
VALUES ('10000006', ‘38341003’, '10-Apr-12', 'GP001', 'p1005', 'Rx1');