我写了个存储过程,测试能通过,但是应用时总提示参数个数或类型出错,请能者帮忙解决!!
错误:ORA-06550:第1行,第7列:PLS-00306:wrongnumberortypesofargumentsincallto'P_C_DS_ESL_EXPDA...
错误:ORA-06550: 第 1 行, 第 7 列: PLS-00306: wrong number or types of arguments in call to 'P_C_DS_ESL_EXPDATA1' ORA-06550: 第 1 行, 第 7 列: PL/SQL: Statement ignored
存储过程:
CREATE OR REPLACE PROCEDURE P_C_DS_ESL_EXPDATA
(I_PARA VARCHAR2 ,
O_SQL OUT VARCHAR2
)
IS
v_SysDate DATE;
v_Num INT;
e_Error EXCEPTION;
BEGIN
v_Sysdate := SYSDATE;
--判断是否有待回传的任务
SELECT COUNT(ID)
INTO v_Num
FROM T_C_ESL_BITASK
WHERE Status = 0 ;
IF v_Num = 0 THEN
RAISE e_Error;
END IF;
O_SQL := 'select T.CITYID,'
|| ' T.ACCEPTPHONE,'
|| ' T.CALLSTATUS ,'
|| ' C.EXT01,'
|| ' C.EXT02,'
|| ' C.EXT03 ,'
|| ' NULL'
|| ' FROM T_ESL_SERVICEINFO T ,'
|| ' T_C_ESL_BITASK A,'
|| ' T_C_ESL_BIRELCAMPAIGN B,'
|| ' T_C_ESL_BIRECORD C '
|| ' WHERE T.CAMPAIGNID = A.CAMPAIGNID'
|| ' AND A.CAMPAIGNID = B.CAMPAIGNID'
|| ' AND B.Fileid = C.Fileid '
|| ' AND A.Status = 0 ';
COMMIT;
--更新回传任务状态
UPDATE T_C_ESL_BITASK
SET Status = 1 , --成功
operateTime = v_Sysdate
WHERE Status = 0 ;
EXCEPTION
-- 空数据异常
WHEN e_Error THEN
-- 返回SQL为'无回传任务'
O_SQL:='SELECT 1, ''没有相应的回传任务'' FROM DUAL';
COMMIT;
WHEN OTHERS THEN
--更新回传任务状态
UPDATE T_C_ESL_BITASK
SET Status = 2 , --失败
operateTime = v_Sysdate
WHERE Status = 0 ;
COMMIT;
END P_C_DS_ESL_EXPDATA;
相关表:CREATE TABLE T_C_ESL_BITASK
( ID VARCHAR2(30) NOT NULL ENABLE,
STAFFID VARCHAR2(30),
CAMPAIGNID VARCHAR2(30),
FILENAME VARCHAR2(60),
OPERATETIME DATE,
STATUS NUMBER) 展开
存储过程:
CREATE OR REPLACE PROCEDURE P_C_DS_ESL_EXPDATA
(I_PARA VARCHAR2 ,
O_SQL OUT VARCHAR2
)
IS
v_SysDate DATE;
v_Num INT;
e_Error EXCEPTION;
BEGIN
v_Sysdate := SYSDATE;
--判断是否有待回传的任务
SELECT COUNT(ID)
INTO v_Num
FROM T_C_ESL_BITASK
WHERE Status = 0 ;
IF v_Num = 0 THEN
RAISE e_Error;
END IF;
O_SQL := 'select T.CITYID,'
|| ' T.ACCEPTPHONE,'
|| ' T.CALLSTATUS ,'
|| ' C.EXT01,'
|| ' C.EXT02,'
|| ' C.EXT03 ,'
|| ' NULL'
|| ' FROM T_ESL_SERVICEINFO T ,'
|| ' T_C_ESL_BITASK A,'
|| ' T_C_ESL_BIRELCAMPAIGN B,'
|| ' T_C_ESL_BIRECORD C '
|| ' WHERE T.CAMPAIGNID = A.CAMPAIGNID'
|| ' AND A.CAMPAIGNID = B.CAMPAIGNID'
|| ' AND B.Fileid = C.Fileid '
|| ' AND A.Status = 0 ';
COMMIT;
--更新回传任务状态
UPDATE T_C_ESL_BITASK
SET Status = 1 , --成功
operateTime = v_Sysdate
WHERE Status = 0 ;
EXCEPTION
-- 空数据异常
WHEN e_Error THEN
-- 返回SQL为'无回传任务'
O_SQL:='SELECT 1, ''没有相应的回传任务'' FROM DUAL';
COMMIT;
WHEN OTHERS THEN
--更新回传任务状态
UPDATE T_C_ESL_BITASK
SET Status = 2 , --失败
operateTime = v_Sysdate
WHERE Status = 0 ;
COMMIT;
END P_C_DS_ESL_EXPDATA;
相关表:CREATE TABLE T_C_ESL_BITASK
( ID VARCHAR2(30) NOT NULL ENABLE,
STAFFID VARCHAR2(30),
CAMPAIGNID VARCHAR2(30),
FILENAME VARCHAR2(60),
OPERATETIME DATE,
STATUS NUMBER) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |