Compilation errors for FUNCTION KDCNEW.F_DONGT_GETJCZHTError: PLS-00103: 出现符号 "CASE"在需要下列之一时:
       (-+modnotnullothers
          <an identifier><a double-quoted delimited-identifier>
          <a bind variable>avgcountcurrentexistsmaxminpriorsqlstddev
          sumvarianceexecuteforalltimetimestampintervaldate
          <a string literal with character set specification>
          <a number><a single-quoted SQL string>
Line: 33
Text: select useunitid,(case when sgjk is null then zzjs||ljjc else sgjk end)

解决方案 »

  1.   

    select useunitid,(case when sgjk is null then zzjs||'/'||ljjc else sgjk end case ) tt from p_zjrb where useunitid='10534' and to_char(rbrq,'yyyy-mm-dd') ='2004-03-29'
      

  2.   

    用case when 的时候要使用动态sql
      

  3.   

    搞定了:)
    用动态sql!
    谢谢各位!
      

  4.   

    试试这个!
     v_sql :='select useunitid,(case when sgjk is null then zzjs||''/''||ljjc else sgjk end) from p_zjrb  where useunitid='''||as_code||''' and to_char(rbrq,''yyyy-mm-dd'') ='''||as_date||'''';      
       execute immediate v_sql into v_name,v_result;