如下sql语句:
update MerchandiseBase set printDate = (case when printDate is not null then to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') else '' end)
在sqlplus执行是成功但是把如下:
create or replace procedure modify_pro as
begin
update MerchandiseBase set printDate = (case when printDate is not null then to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') else '' end)
end
在sqlplus下执行就报编译性错误:
Warning: Procedure created with compilation errors.到底哪里错了,我自己都糊涂了,今儿事真多,真的糊涂了
update MerchandiseBase set printDate = (case when printDate is not null then to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') else '' end)
在sqlplus执行是成功但是把如下:
create or replace procedure modify_pro as
begin
update MerchandiseBase set printDate = (case when printDate is not null then to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') else '' end)
end
在sqlplus下执行就报编译性错误:
Warning: Procedure created with compilation errors.到底哪里错了,我自己都糊涂了,今儿事真多,真的糊涂了
解决方案 »
- 急求高手解决这个函数问题
- create procedure中的is 和as有什么差别啊?
- 为什么创建类型实体时会报 警告:创建的类型体带有编译错误
- 有没有人能给我写条Sql
- 从SQLserver 导入 oracle 的数据表没主键,怎么设置啊???谢谢啊!
- 视图中有数据,但用Enterprise Manager Console或SQL Plus查看都为空,可能是什么原因?在线等!THANKS!!!
- 寻求oracle存储过程语法的相关资料
- 初次接触ORACLE,问一个初级的问题.请各位高手帮忙!
- 删除数据库的internal口令是什么啊?
- oracle expdp 问题
- 请教如何在sql语句中实现某字段值累加1?
- 求一存储过程语句;
begin
update MerchandiseBase set printDate = (case when printDate is not null then to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') else '' end);
end;
/下面的写法是不是更加容易看懂
create or replace procedure modify_pro as
begin
update MerchandiseBase set printDate = to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') where printDate is not null ;
end;
/
begin
update MerchandiseBase set printDate = (case when printDate is not null then to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') else '' end);
end;
/
试试。
看看提示的编译错误是什么
end 后面也要加 ;
并调试存储过程比较好
DECODE(null,'',to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD'));
begin
update MerchandiseBase set printDate = (case when printDate is not null then to_char(to_date(printDate, 'YYYY-MM-DD')+1, 'YYYY-MM-DD') else '' end);--少了
end
少了一个分号.