在一段代码中出现 v_empno:=&x;
运行代码时需要输入x的值,请问上述代码中&是什么意思,,谢谢啦

解决方案 »

  1.   

     declare 
        t_sal tmp_emp.sal%type;
        t_i number(4);
        t_di tmp_emp.di%type;
        begin
          t_di:=&x;
          select sal into t_sal from tmp_emp where di=t_di;
          case
            when t_sal<1200 then t_i:=200;
            when t_sal<2000 then t_i:=150;
            when t_sal<4000 then t_i:=100;
            else t_i:=50;
            end case;
            update tmp_emp set sal=sal+t_i where di=t_i;
            end;是这段代码里的,可不管x输入什么值,这段代码运行后,查询表tmp_emp 的时候,里面的内容没有发生变化。
      

  2.   


    update tmp_emp set sal=sal+t_i where di=t_i; 说明没有找到匹配的行,没有修改过,所以没变化
      

  3.   

    &x表明PL/SQL程序在执行时,需要输入的变量。