sql - PLS-00103:遇到符号“ELSE”
问题描述
我遇到了这个问题。
case room_rec.roomID
37 when null
38 then v_counter := v_counter
39 else v_counter := v_counter+1
40 end as counter;
显示此错误消息
LINE/COL ERROR
-------- -----------------------------------------------------------------
39/7 PLS-00103: Encountered the symbol "ELSE" when expecting one of
the following:
. ( * @ % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
The symbol ";" was substituted for "ELSE" to continue.
40/6 PLS-00103: Encountered the symbol "END" when expecting one of the
following:
* & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
我希望明智地运行此案例,但错误消息弹出多次。
解决方案
您的代码应该是:
v_counter := case when room_rec.roomID is null
then v_counter
else v_counter+1
end;
推荐阅读
- c# - 来自 Instagram 内部 API C# 的经过身份验证的响应
- git - 从拉取请求中删除提交并在 bitbucket 中分支
- node.js - 我从 nodejs 服务器获取的数据是空的并且没有显示结果
- windows - 在 MASM 中使用 PlaySound(),需要一种方法来帮助在后台运行它,而无需等待整个 .wav 声音文件完成的代码
- r - 使用 dplyr 从矩阵中提取值以添加到数据框列
- python - 如何在 (Anaconda) Spyder 中使用 Blender 中的 blenderpy 模块
- php - 如何在 Laravel 中动态链接函数?
- javascript - 表单标签中的 action='action-page' 和 target='_blank'
- .net-assembly - 将外部程序集 (RCL) 加载到 Blazor WebAssembly 应用程序
- php - 如何在不使用 echo / print 的情况下下载 PHP 生成的 ics 文件