写了一个简单的oracle存储过程 实现表的字段更新
CREATEORREPLACEPROCEDUREADD_CUST_TYPEISBEGINUPDATECUS_CUST_INFOCISETCI.CUST_STYLE_VER...
CREATE OR REPLACE PROCEDURE ADD_CUST_TYPE
IS
BEGIN
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '大型核心客户'
WHERE
CI_CUST_SCALE_ID = '11' AND
FCC_CUST_CLASSIFIED_ID = '111';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '大型战略客户'
WHERE
CI_CUST_SCALE_ID = '11' AND
FCC_CUST_CLASSIFIED_ID = '112';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '大型基础客户'
WHERE
CI_CUST_SCALE_ID = '11' AND
FCC_CUST_CLASSIFIED_ID = '113';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '中型核心客户'
WHERE
CI_CUST_SCALE_ID = '12' AND
FCC_CUST_CLASSIFIED_ID = '111';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '中型战略客户'
WHERE
CI_CUST_SCALE_ID = '12' AND
FCC_CUST_CLASSIFIED_ID = '112';
COMMIT;
END ADD_CUST_TYPE;
在PLSQL写好后按F8执行 无异常
然后用EXEC ADD_CUST_TYPE;调用这个存储过程 提示“无效的SQL语句”
SELECT * FROM All_Objects a WHERE a.OBJECT_TYPE = 'PROCEDURE'查看 里面没有这个存储过程
应该是没提交上
请问哪里有错 展开
IS
BEGIN
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '大型核心客户'
WHERE
CI_CUST_SCALE_ID = '11' AND
FCC_CUST_CLASSIFIED_ID = '111';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '大型战略客户'
WHERE
CI_CUST_SCALE_ID = '11' AND
FCC_CUST_CLASSIFIED_ID = '112';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '大型基础客户'
WHERE
CI_CUST_SCALE_ID = '11' AND
FCC_CUST_CLASSIFIED_ID = '113';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '中型核心客户'
WHERE
CI_CUST_SCALE_ID = '12' AND
FCC_CUST_CLASSIFIED_ID = '111';
UPDATE CUS_CUST_INFO CI
SET CI.CUST_STYLE_VER = '中型战略客户'
WHERE
CI_CUST_SCALE_ID = '12' AND
FCC_CUST_CLASSIFIED_ID = '112';
COMMIT;
END ADD_CUST_TYPE;
在PLSQL写好后按F8执行 无异常
然后用EXEC ADD_CUST_TYPE;调用这个存储过程 提示“无效的SQL语句”
SELECT * FROM All_Objects a WHERE a.OBJECT_TYPE = 'PROCEDURE'查看 里面没有这个存储过程
应该是没提交上
请问哪里有错 展开
展开全部
骚年,问题出在了你的update语句,哥表示无语。。。请睁大眼睛看:
'11' AND
'11' AND
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询