Oracle PL/SQL查询无法编译 [英] Oracle PL/SQL query does not compile

查看:93
本文介绍了Oracle PL/SQL查询无法编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我为什么它不能编译吗?我收到缺少表达式"错误:

Can anyone tell me why this won't compile? I get a 'missing expression' error:

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;

假设所有变量都正确声明.

Assume the variables are all correctly declared.

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;

这篇关于Oracle PL/SQL查询无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆