这个存储过程错在哪里了?

JJY1981 2004-01-06 05:02:41
1 create or replace procedure ci
2 as
3 n_cust_id snap_cust_info.cust_id%TYPE;
4 begin
5 select cust_id into n_cust_id from snap_cust_info where input_date = to_char(sysdate,'yyyymmdd');
6 if nvl(n_cust_id,123) then
7 insert into tb_cust_prem_info select poh_cust_id,insan_amt from snap_policy_info where poh_cust_id=n_cust_id;
8 end ci;
------------------------------------------------------------------------
报错是:
LINE/COL ERROR
-------- -----------------------------------------------------------------
8/5 PLS-00103: Encountered the symbol "CI" when expecting one of the
following:
if
...全文
47 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
LGQDUCKY 2004-01-06
  • 打赏
  • 举报
回复
就是我要表达 if n_cust_id!=Null then
……
不知道pl/sql怎么表达

if n_cust_id is not null then 这样判断!
qyflaoda 2004-01-06
  • 打赏
  • 举报
回复
if (n_cust_id is null) then
zlqs 2004-01-06
  • 打赏
  • 举报
回复
if n_cust_id<>null then
insert into tb_cust_prem_info select poh_cust_id,insan_amt from snap_policy_info where poh_cust_id=n_cust_id;
end if
JJY1981 2004-01-06
  • 打赏
  • 举报
回复
if nvl(n_cust_id,123) then //这句就是判断是不是为空,不为空的话执行下面语句

就是我要表达 if n_cust_id!=Null then
……
不知道pl/sql怎么表达
zlqs 2004-01-06
  • 打赏
  • 举报
回复
换为
if n_cust_id=null then
zlqs 2004-01-06
  • 打赏
  • 举报
回复
if nvl(n_cust_id,123) then


这句有问题
bzszp 2004-01-06
  • 打赏
  • 举报
回复
if isnull(n_cust_id) then//是不是判断是否为空?
insert into tb_cust_prem_info select poh_cust_id,insan_amt from snap_policy_info where poh_cust_id=n_cust_id;
end if;
end ci;

17,089

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧