sql - plsql错误无效号码

标签 sql oracle plsql ora-01722

我在以下情况下收到无效号码错误

procedure Afficher(opt int,id int) is
type emp is record(fn employees.first_name%type,
                   lname employees.last_name%type,
                   job jobs.job_title%type,
                   dep departments.department_id%type);
emp1 emp;
begin
select e1.first_name,e1.last_name,j.job_title,d.department_name into emp1
from employees e1 ,jobs j,departments d where e1.employee_id= 'id' and 
e1.job_id=j.job_id and e1.department_id =d.department_id ;

      dbms_output.put_line('Name      Job       Department');
      dbms_output.put_line(emp1.fn||''|| emp1.lname||'     '
            ||emp1.job||'   '||emp1.dep);

end Afficher;

最佳答案

您正在寻找e1.employee_id='id';它实际上是一个字符串,还是一个数字?

关于sql - plsql错误无效号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5201948/

相关文章:

sql - 选择顶行时使用了错误的索引

sql - TSQL SELECT 语句中的 "As"和 "="有什么区别?

oracle - 隐藏 Oracle XE 数据库中的表

python - 类型错误 : "list indices must be integers" looping through tuples in python

sql - Oracle 约束允许每个外键值一次特定值

sql - 获取一定数量的连续行

oracle - 我们如何在PL SQL中在特定时间后自动删除表行

mysql - 查询没有像预期的那样工作

MySQL 错误代码 1215 : “Cannot add foreign key constraint”

mysql - 对于这种缓慢的 MySQL 查询,最好的索引是什么? (InnoDB)