我有一个以 emp_no 作为主键的表 non_employee 和一个包含要插入该表的过程的包。
我需要能够在程序运行时自动增加 emp_no。我尝试在这样的过程中创建一个序列,但出现错误。请参阅下文和建议。
CREATE OR REPLACE PACKAGE BODY WFDDEV."ERD" IS
create SEQUENCE @seq_emp_nmbr;
PROCEDURE INS_NON_EMPLOYEES
(
in_DATE_ADDED DATE,
in_EMPLOYEE_NAME VARCHAR2,
in_DEPT_ID VARCHAR2,
in_SUB_DEPARTMENT VARCHAR2,
in_LOCATION VARCHAR2,
in_WORK_TEL_NO VARCHAR2,
in_TOUR VARCHAR2,
in_REST_DAYS VARCHAR2,
in_HOME_ADDRESS VARCHAR2,
in_CITY VARCHAR2,
in_STATE VARCHAR2,
in_ZIP VARCHAR2,
in_HOME_TEL_NO VARCHAR2,
in_GENDER VARCHAR2,
in_RACE VARCHAR2,
in_DATE_OF_BIRTH DATE,
in_AGE VARCHAR2,
in_HIRE_DATE DATE,
in_UNION_AFFILIATION VARCHAR2,
in_TITLE VARCHAR2,
in_NON_EE_INDICATOR VARCHAR2
) IS
BEGIN
INSERT INTO WFDDEV.NON_EMPLOYEES
(
EMP_NO,
DATE_ADDED,
EMPLOYEE_NAME,
DEPT_ID,
SUB_DEPARTMENT,
LOCATION,
WORK_TEL_NO,
TOUR,
REST_DAYS,
HOME_ADDRESS,
CITY,
STATE,
ZIP,
HOME_TEL_NO,
GENDER,
RACE,
DATE_OF_BIRTH,
AGE,
HIRE_DATE,
UNION_AFFILIATION,
TITLE,
NON_EE_INDICATOR
)
VALUES
(
emp_no.NEXTVAL,
in_DATE_ADDED,
in_EMPLOYEE_NAME,
in_DEPT_ID,
in_SUB_DEPARTMENT,
in_LOCATION,
in_WORK_TEL_NO,
in_TOUR,
in_REST_DAYS,
in_HOME_ADDRESS,
in_CITY,
in_STATE,
in_ZIP,
in_HOME_TEL_NO,
in_GENDER,
in_RACE,
in_DATE_OF_BIRTH,
in_AGE,
in_HIRE_DATE,
in_UNION_AFFILIATION,
in_TITLE,
in_NON_EE_INDICATOR
);
END;
我得到 PLS-00103:在预期以下情况之一时遇到符号“CREATE”:
开始 结束 函数 pragma 过程 子类型 类型
这个错误...