update tablea set psw='=!>1=!' where id=1;
update tablea set psw='_P_YDY' where id=2;
update tablea set psw='XI)J&4' where id=3;
这三个sql语句做为一个脚本执行,执行到第三句时,会提示4是个变量,要求输入变量值,请问怎样修改可以使psw最终结果为XI)J&4
谢谢

解决方案 »

  1.   

    &在plsql dev中有特别意义,
    用&&表示&
      

  2.   

    Escape characterIf you wish to use an ampersand in the SQL text that should not be interpreted as a substitution variable, use a double ampersand instead. The following example will retrieve all employees from the 'R&D' department:select * from emp
    where emp.deptno in (select dept.deptno from dept
                         where dname = 'R&&D')
    order by empno descIf the text 'R&D' had been used instead, you would have been prompted for the D variable.
      

  3.   

    SQL> set define off;
    SQL> select '&test' from dual;'&TEST'
    -------
    &test关闭变量定义就可以了