Oracle PL/SQL 查询未编译
Oracle PL/SQL query does not compile
谁能告诉我为什么这不能编译?我收到 'missing expression' 错误:
execute immediate 'select CASE WHEN EXISTS ( SELECT 1 from samples where samplecode = :samplecode and auditflag = 0 and ' || varFilterString || ') then 1 else 0 end from DUAL'
into varResult
using varSampleCode;
假设变量都已正确声明。
TIA
execute immediate 'select count(1) from DUAL
where EXISTS
( SELECT 1 from samples
where samplecode = :sample code
and auditflag = 0
and ' || varFilterString || ')'
into varResult
using varSampleCode;
谁能告诉我为什么这不能编译?我收到 'missing expression' 错误:
execute immediate 'select CASE WHEN EXISTS ( SELECT 1 from samples where samplecode = :samplecode and auditflag = 0 and ' || varFilterString || ') then 1 else 0 end from DUAL'
into varResult
using varSampleCode;
假设变量都已正确声明。
TIA
execute immediate 'select count(1) from DUAL
where EXISTS
( SELECT 1 from samples
where samplecode = :sample code
and auditflag = 0
and ' || varFilterString || ')'
into varResult
using varSampleCode;