我希望你一切安好。我需要您帮助解决卡普兰三重考试题中的以下问题。下面的查询应该是正确答案,但我无法让它工作。您能否检查并提出建议。
RGD的
诺曼
SQL> EDIT
Wrote file afiedt.buf
INSERT INTO
(SELECT PHYSICIAN_ID, LAST_NAME, FIRST_NAME, LICENSE_NO, HIRE_DATE
FROM PHYSICIAN
WITH CHECK OPTION
WHERE LICENSE_NO BETWEEN 1 AND 200)
VALUES (PHY_NUM_SEQ.NEXTVAL, '&LNAME', '&FNAME', &LNO, SYSDATE)
SQL> /
**Enter value for lname: BARRETT
Enter value for fname: NORMAN
Enter value for lno: 1**
old 6: VALUES (PHY_NUM_SEQ.NEXTVAL, '&LNAME', '&FNAME', &LNO, SYSDATE)
new 6: VALUES (PHY_NUM_SEQ.NEXTVAL, 'BARRETT', 'NORMAN', 1, SYSDATE)
WHERE LICENSE_NO BETWEEN 1 AND 200)
*
> **ERROR at line 5: ORA-00907: missing right parenthesis**
SQL> `SELECT PHY_NUM_SEQ.NEXTVAL FROM DUAL;`
NEXTVAL
----------
1
SQL> DESC PHYSICIAN
Name Null? Type
----------------------------------------- -------- ----------------------------
PHYSICIAN_ID NOT NULL NUMBER
LAST_NAME NOT NULL VARCHAR2(30)
FIRST_NAME NOT NULL VARCHAR2(25)
LICENSE_NO NOT NULL NUMBER(7)
HIRE_DATE DATE
SQL>
有WITH CHECK OPTION
行导致错误
ORA-00907:缺少右括号
在您的SELECT
声明中。
删除该行就足够了。