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)
(-+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)
用动态sql!
谢谢各位!
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;