存储过程如下:
CREATE OR REPLACE PROCEDURE P_CUSTOMERATTRIBUTE IS
--变量声明
STRATTRIBUTE NVARCHAR2(100);
NUMSTARTPOSITION NUMBER;
NUMENDPOSITION NUMBER;
NUMLOOP NUMBER;
EXITFLAG BOOLEAN;
BEGIN
FOR CUSTM IN (SELECT * FROM CRMS.T_CRM_CUSTOMER) LOOP
IF LENGTH(CUSTM.CUSTOMERATTRIBUTEIDS) > 0 THEN
--局部变量赋值
EXITFLAG := FALSE;
NUMSTARTPOSITION := 1;
NUMLOOP := 1;
问题如下:
调试的时候,看CUSTM.CUSTOMERATTRIBUTEIDS的值,显示为“NULL”,但数据库里绝对有值,为什么呢??
第一次写存储过程,请见谅......
------解决方案--------------------
代码迷推荐解决方案:oracle存储过程,http://www.daimami.com/search?q=177537
------解决方案--------------------
FOR CUSTM IN (SELECT * FROM CRMS.T_CRM_CUSTOMER) LOOP
改为:
FOR CUSTM IN (SELECT CUSTM FROM CRMS.T_CRM_CUSTOMER) LOOP
------解决方案--------------------
我曾经就犯过类是的错误
扣了我5分的信誉分