但是,尝试使用此处提供的此代码时,它会在尝试运行时返回以下错误:
PLS-00103:在预期以下情况之一时遇到符号“IS”: 常量异常表 long double ref char 时间时间戳间隔 日期二进制国家字符 nchar 1. 声明 2.emp员工%ROWTYPE; 3. tbl_emp 是 emp 表; 4. v_user_type 员工.user_type%TYPE; 5. 开始
代码是:
DECLARE
emp employee%ROWTYPE;
tbl_emp IS TABLE OF emp;
v_user_type employee.user_type%TYPE;
BEGIN
SELECT user_type
INTO v_user_type
FROM Employee
WHERE upper(username) = v('APP_USER');
IF v_user_type = 1
THEN
SELECT * BULK COLLECT INTO tbl_emp
FROM employee;
ELSE
SELECT * BULK COLLECT INTO tbl_emp
FROM employee;
WHERE upper(username) = v('APP_USER');
END IF;
END;
/