CREATE OR REPLACE procedure verify_employee
(emp_license IN trkdriver.L#%TYPE)
IS
result VARCHAR2(10);
BEGIN
select e# INTO result
from trkdriver where l#='emp_license';
END;
/
以上是我的程序
SQL> desc trkdriver;
Name Null? Type
----------------------------------------- -------- ----------------------------
E# NOT NULL NUMBER(12)
L# NOT NULL NUMBER(8)
STATUS NOT NULL VARCHAR2(10)
我尝试过了
SQL> execute verify_employee('10001');
BEGIN verify_employee('10001'); END;
*
ERROR at line 1:
ORA-01722: invalid number
ORA-06512: at "USER1.VERIFY_EMPLOYEE", line 7
ORA-06512: at line 1
我做错了什么,我只想尝试一个简单的程序,该程序将根据我输入的员工许可证 ID 进行选择