CREATE OR REPLACE PROCEDURE delDic(id1 number)
AS
childCount number DEFAULT 0;
parentID number DEFAULT 0;
BEGIN
select parent_id into parentID from sys_dic where dic_id = id1;
if (parentID > 0) then
begin
select count(dic_id) into childCount from sys_dic where parent_id = parentID and dic_status = 'active';
update sys_dic set child_count = childCount where dic_id = parentID;
end;
end if;
commit;
END;
能不能看我的创建语句看看问题所在,而不是拷贝别的地方答案,谢谢了
就提示 [Err] ORA-24344: success with compilation error 可是我去掉commit语句也不可以
追答SELECT xx INTO 变量 FROM ...,这个语法有问题(INTO的是表,而非变量)。
改成如下试试:
SELECT 变量 = xx FROM ...
我把if语句去掉就不报错了,我换衣是if语句格式哪里错误了?您能把我看下吗