DECODE 只能用于SQL语句中,你可以 :
fetch unit_into into refunit;
SELECT decode(refunit.GMFS,0,'一般',1,'按揭',null) INTO tempstr FROM DUAL;

解决方案 »

  1.   

    decode是ORACLE对SQL语句设计的函数。只能用于SQL语句
      

  2.   

    DECODE(变量,
           '0','一般',  -- 如果等于 '0'
           '1','按揭',  -- 为 '1'
           null)
    为 0 和 1 加上单引号试试.
      

  3.   

    decode 函数没有返回值,所以不能用变量接收。
    例如:
    select decode(state_cd,'ma','east',
                           'nj','west',
                            'middle of river' 
                                       )
    from customer;
    相当于
    if state_cd='ma' then
       display 'east'
    elsif state_cd='nj' then
       display 'west'
    else display 'middle of river' ;
      

  4.   

    楼上的说得对,decode只是一个条件分支判断的函数