存储过程提示“PLS-00306:wrong number or types of arguments in call to "APPEND" PL/SQL:Statment ignored”

非著名魔兽解说 发布于 2016/09/18 09:50
阅读 1K+
收藏 0

@IdleMan 你好,想跟你请教个问题:

存储过程提示:“PLS-00306:wrong number or types of arguments in call to "APPEND"
PL/SQL:Statment ignored”

请问这个怎么处理呢?

存储过程代码如下:

CREATE OR REPLACE
PROCEDURE "PR_ECOS_CUSTBACK_HEAD_QUERY"  (
													V_PAGE_NO   IN  VARCHAR2,--页面Number
													V_FUN_ID    IN  VARCHAR2,--页面Number,对应的功能方法ID
													V_OUT_RETURN OUT VARCHAR2,--子存储过程的输出参数,传递给主存储过程,主存储过程根据这个返回值判断执行子存储过程是否成功
													V_OUT_JSON   OUT CLOB --生成的json,返回给前段调用者  						
)
 IS
V_TOTAL      VARCHAR(100);
V_OU_MSG     VARCHAR(3000);
V_NUM        NUMBER;--查询"ECOS_Op_CustFeedBack_Head"表的全部记录数
BEGIN

	V_OUT_RETURN := '';

	--IF V_PAGE_NO ='001' AND V_FUN_ID ='select' THEN
		SELECT COUNT(1) into V_NUM   FROM  ECOS_Op_CustFeedBack_Head;
		dbms_lob.append(V_OUT_JSON, '{');
        dbms_lob.append(V_OUT_JSON, '"total":');
        dbms_lob.append(V_OUT_JSON, V_NUM);
        dbms_lob.append(V_OUT_JSON, ',');
        dbms_lob.append(V_OUT_JSON, '"rows": [');
				for item in(SELECT  
					Row_ID,
					LinkOrderNumber,
					CustomerID,
					ReceiverName,
					Telephone,
					StoreName,
					Region,
					ReceiveAddress,
					OrderAmount,
					OrderDate,
					SendWarehouse,
					EventLevel,
					InternalServer,
					CostAmount,
					BackFreight,
					BackAddress,
					RecordStatus,
					CreateDate,
					CreaterID,
					ModifyDate,
					ModifierID,
					DeleteFlag,
					Note
        FROM   ECOS_OP_CUSTFEEDBACK_HEAD ) loop 
				dbms_lob.append(V_OUT_JSON, '{');   

				dbms_lob.append(V_OUT_JSON, '"Row_ID":');     
				dbms_lob.append(V_OUT_JSON, item.Row_ID);    
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"LinkOrderNumber":');     
				dbms_lob.append(V_OUT_JSON, item.LinkOrderNumber);    
				dbms_lob.append(V_OUT_JSON, ','); 
				
				dbms_lob.append(V_OUT_JSON, '"CustomerID":');     
				dbms_lob.append(V_OUT_JSON, item.CustomerID);    
				dbms_lob.append(V_OUT_JSON, ','); 

				dbms_lob.append(V_OUT_JSON, '"ReceiverName":"');     
				dbms_lob.append(V_OUT_JSON, item.ReceiverName);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ','); 

				dbms_lob.append(V_OUT_JSON, '"Telephone":');     
				dbms_lob.append(V_OUT_JSON, item.Telephone);   
				dbms_lob.append(V_OUT_JSON, ','); 
				
				dbms_lob.append(V_OUT_JSON, '"StoreName":"');     
				dbms_lob.append(V_OUT_JSON, item.StoreName);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ','); 

				dbms_lob.append(V_OUT_JSON, '"Region":"');     
				dbms_lob.append(V_OUT_JSON, item.Region);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');
				
				dbms_lob.append(V_OUT_JSON, '"ReceiveAddress":"');     
				dbms_lob.append(V_OUT_JSON, item.ReceiveAddress);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"OrderAmount":');     
				dbms_lob.append(V_OUT_JSON, item.OrderAmount);   
				dbms_lob.append(V_OUT_JSON, ','); 

				dbms_lob.append(V_OUT_JSON, '"OrderDate":"');     
				dbms_lob.append(V_OUT_JSON, item.OrderDate);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"SendWarehouse":"');     
				dbms_lob.append(V_OUT_JSON, item.SendWarehouse);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"EventLevel":"');     
				dbms_lob.append(V_OUT_JSON, item.EventLevel);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"InternalServer":"');     
				dbms_lob.append(V_OUT_JSON, item.InternalServer);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');		

				dbms_lob.append(V_OUT_JSON, '"CostAmount":');     
				dbms_lob.append(V_OUT_JSON, item.CostAmount);   
				dbms_lob.append(V_OUT_JSON, ',');	

				dbms_lob.append(V_OUT_JSON, '"BackFreight":"');     
				dbms_lob.append(V_OUT_JSON, item.BackFreight);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');
				
				dbms_lob.append(V_OUT_JSON, '"BackAddress":"');     
				dbms_lob.append(V_OUT_JSON, item.BackAddress);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"RecordStatus":"');     
				dbms_lob.append(V_OUT_JSON, item.RecordStatus);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"CreateDate":"');     
				dbms_lob.append(V_OUT_JSON, item.CreateDate);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"CreaterID":');     
				dbms_lob.append(V_OUT_JSON, item.CreaterID);   
				dbms_lob.append(V_OUT_JSON, ','); 
	
				dbms_lob.append(V_OUT_JSON, '"ModifyDate":"');     
				dbms_lob.append(V_OUT_JSON, item.ModifyDate);   
				dbms_lob.append(V_OUT_JSON, '"'); 
				dbms_lob.append(V_OUT_JSON, ',');

				dbms_lob.append(V_OUT_JSON, '"ModifierID":');     
				dbms_lob.append(V_OUT_JSON, item.ModifierID);   
				dbms_lob.append(V_OUT_JSON, ','); 

				dbms_lob.append(V_OUT_JSON, '"DeleteFlag":');     
				dbms_lob.append(V_OUT_JSON, item.DeleteFlag);   
				dbms_lob.append(V_OUT_JSON, ','); 

				dbms_lob.append(V_OUT_JSON, '"Note":"');     
				dbms_lob.append(V_OUT_JSON, item.Note);   
				dbms_lob.append(V_OUT_JSON, '"'); 

				dbms_lob.append(V_OUT_JSON, '},');    
				end loop; 
				SELECT SUBSTR(V_OUT_JSON, 0, length(V_OUT_JSON)-1) into V_OUT_JSON FROM DUAL;
				dbms_lob.append(V_OUT_JSON, '],
					"footer": null,
					"columns": null,
					"frozenColumns": null,
					"AttachRemark": null,
					"Attach": null}'); 

			--COMMIT;查询时不需要COMMIT
			V_OUT_RETURN := 'OK';

	EXCEPTION
    WHEN OTHERS THEN
    V_OUT_RETURN := 'ERROR';
    V_OU_MSG    := '失败,原因是:' || SQLERRM;
    ROLLBACK;
    INSERT INTO SYS_ERROR_LOG
      (ROW_ID, PR_NAME, ERROR_DESC, INSDT)
    VALUES
      (SYS_ERROR_LOG_SEQ.NEXTVAL, 'PR_ECOS_CUSTBACK_HEAD_QUERY', V_OU_MSG, SYSDATE);
    COMMIT;
END PR_ECOS_CUSTBACK_HEAD_QUERY;



截图如下:


我自己尝试的时候都没事:

如下图:

加载中
0
IdleMan
IdleMan

 dbms_lob.append(V_OUT_JSON, V_NUM);
->
 dbms_lob.append(V_OUT_JSON,to_char( V_NUM));

非著名魔兽解说
非著名魔兽解说
谢谢!
返回顶部
顶部