gpt4 book ai didi

plsql - ORA-06550 : line 1, 第 7 列 : PLS-00905: object DMQ1STG. CPS_SCHEDULE_SETUP_PROCESS 无效

转载 作者:行者123 更新时间:2023-12-04 16:11:07 26 4
gpt4 key购买 nike

我正在尝试执行此过程但出现错误 - 对象无效用户有足够的权限..请帮忙

CREATE OR REPLACE PROCEDURE CPS_SCHEDULE_SETUP_PROCESS
IS
CURSOR cpsSCHEDULErecords
IS
SELECT *
FROM cps_schedule_setup
WHERE active = 'Yes' AND complete = 'No';--decode(recurring,'Yes',end_date + 3 + 3.335/4, end_date + 1 + 3.335/4 ) <= sysdate and end_date + 1 + 1/3 <= sysdate and NVL(schedule_date,SYSDATE) <= sysdate;

nWorkList INTEGER := 0;

nSchedule INTEGER := 0;

dNewEndDT DATE;

dNewStartDT DATE;
BEGIN
FOR rec IN cpsSCHEDULErecords
LOOP
DBMS_OUTPUT.PUT_LINE (
' Processing - ClientNum: '
|| TO_CHAR (rec.CLIENT_NUM)
|| ' StartDT: '
|| TO_CHAR (rec.START_DATE)
|| ' EndDT: '
|| TO_CHAR (rec.END_DATE));

IF rec.RESCHEDULE_DATE IS NULL
THEN
BEGIN
CPS_OVERRIDE_UPDATE_SR_FACT (rec.CLIENT_NUM,
'N',
rec.START_DATE,
rec.END_DATE);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE (
'Error:' || SQLCODE || ' Msg: ' || SQLERRM);
RAISE;
END;

SELECT COUNT (*)
INTO nWorkList
FROM CPS_CONTENT_MASTER
WHERE CLIENT_NUM = rec.CLIENT_NUM
AND AGREEMENT_NUM = rec.AGREEMENT_NUM
AND START_DATE = rec.START_DATE
AND END_DATE = rec.END_DATE;

IF nWorkList = 0
THEN
INSERT INTO CPS_CONTENT_MASTER
VALUES (CPS_CONTENT_MASTER_SEQ.NEXTVAL,
rec.CLIENT_NUM,
rec.AGREEMENT_NUM,
rec.FREQUENCY,
rec.START_DATE,
rec.END_DATE,
'Inserting AUTHOR SAVE',
'AUTHOR SAVE',
SYSDATE,
'CPS proc',
rec.CONTENT_TYPE,
rec.LANG_ID);
ELSE
UPDATE CPS_CONTENT_MASTER
SET STATUS = 'AUTHOR SAVE'
WHERE CLIENT_NUM = rec.CLIENT_NUM
AND AGREEMENT_NUM = rec.AGREEMENT_NUM
AND START_DATE = rec.START_DATE
AND END_DATE = rec.END_DATE;
END IF;
END IF;

IF rec.RESCHEDULE_DATE IS NOT NULL
THEN
BEGIN
SR_FACT_RESET (rec.CLIENT_NUM,
'Y',
rec.START_DATE,
rec.END_DATE);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE (
'Error:' || SQLCODE || ' Msg: ' || SQLERRM);

RAISE;
END;



BEGIN
CPS_SR_DETAIL_NULL (rec.CLIENT_NUM,
NULL,
rec.START_DATE,
rec.END_DATE);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE (
'Error:' || SQLCODE || ' Msg: ' || SQLERRM);

EXIT;
END;



SELECT COUNT (*)
INTO nWorkList
FROM CPS_CONTENT_MASTER
WHERE CLIENT_NUM = rec.CLIENT_NUM
AND AGREEMENT_NUM = rec.AGREEMENT_NUM
AND START_DATE = rec.START_DATE
AND END_DATE = rec.END_DATE;

IF nWorkList = 0
THEN
INSERT INTO CPS_CONTENT_MASTER
VALUES (CPS_CONTENT_MASTER_SEQ.NEXTVAL,
rec.CLIENT_NUM,
rec.AGREEMENT_NUM,
rec.FREQUENCY,
rec.START_DATE,
rec.END_DATE,
'Inserting AUTHOR SAVE',
'AUTHOR SAVE',
SYSDATE,
'CPS proc',
rec.CONTENT_TYPE,
rec.LANG_ID);
ELSE
UPDATE CPS_CONTENT_MASTER
SET STATUS = 'AUTHOR SAVE'
WHERE CLIENT_NUM = rec.CLIENT_NUM
AND AGREEMENT_NUM = rec.AGREEMENT_NUM
AND START_DATE = rec.START_DATE
AND END_DATE = rec.END_DATE;
END IF;
END IF;

-- ADDED TO PROCESS CMR REPORTS

BEGIN
DBMS_OUTPUT.PUT_LINE ('Now Executing LOAD_MONTH_REPORT ..');

LOAD_MONTH_REPORT (rec.CLIENT_NUM,
rec.AGREEMENT_NUM,
rec.START_DATE,
rec.END_DATE);

DBMS_OUTPUT.PUT_LINE ('Now Executing LOAD_SR_AVAILABILITY_RPT ..');

LOAD_SR_AVAILABILITY_RPT (rec.CLIENT_NUM,
rec.AGREEMENT_NUM,
rec.START_DATE,
rec.END_DATE);

DBMS_OUTPUT.PUT_LINE ('Now Executing LOAD_SR_CLOSE_RPT ..');

LOAD_SR_CLOSE_RPT (rec.CLIENT_NUM,
rec.AGREEMENT_NUM,
rec.START_DATE,
rec.END_DATE);

DBMS_OUTPUT.PUT_LINE ('Now Executing LOAD_SR_RESPONSE_RPT ..');

LOAD_SR_RESPONSE_RPT (rec.CLIENT_NUM,
rec.AGREEMENT_NUM,
rec.START_DATE,
rec.END_DATE);
EXCEPTION
WHEN OTHERS
THEN
RAISE;
END;

-- END

DBMS_OUTPUT.PUT_LINE (
'Trying to UPDATE CPS_SCHEDULE_SETUP to COMPLETE ..');

UPDATE CPS_SCHEDULE_SETUP
SET COMPLETE = 'Yes', COMPLETED_DATE = SYSDATE
WHERE SCHEDULE_ID = rec.SCHEDULE_ID;



DBMS_OUTPUT.PUT_LINE ('Trying to handle RECURRING cases ..');


IF rec.RECURRING = 'Yes'
THEN
dNewStartDT := rec.END_DATE + 1;

IF rec.FREQUENCY = 'MONTHLY'
THEN
dNewEndDT := ADD_MONTHS (dNewStartDT, 1) - 1;
ELSIF rec.FREQUENCY = 'QUARTERLY'
THEN
dNewEndDT := ADD_MONTHS ( (rec.END_DATE + 1), 3) - 1;
ELSIF rec.FREQUENCY = 'WEEKLY'
THEN
dNewEndDT := dNewStartDT + 6;
ELSE
dNewEndDT := NULL;
END IF;


DBMS_OUTPUT.PUT_LINE ('NEW StartDT:' || TO_CHAR (dNewStartDT));

DBMS_OUTPUT.PUT_LINE ('NEW EndDT:' || TO_CHAR (dNewEndDT));

SELECT COUNT (*)
INTO nSchedule
FROM CPS_SCHEDULE_SETUP
WHERE CLIENT_NUM = rec.CLIENT_NUM
AND AGREEMENT_NUM = rec.AGREEMENT_NUM
AND START_DATE = dNewStartDT
AND END_DATE = dNewEndDT;

IF nSchedule > 0
THEN
NULL;
ELSE
INSERT INTO CPS_SCHEDULE_SETUP
VALUES (CPS_SCHEDULE_SETUP_SEQ.NEXTVAL,
rec.CLIENT_NUM,
rec.AGREEMENT_NUM,
dNewStartDT,
rec.FREQUENCY,
dNewEndDT,
rec.CONTENT_TYPE,
'Yes',
'No',
'Yes',
NULL,
NULL,
SYSDATE,
rec.LANG_ID);
END IF;
END IF;

COMMIT;
END LOOP;
-- close cpsSCHEDULErecords;

EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;

DBMS_OUTPUT.PUT_LINE (
'Error during CPS_SCHEDULE_SETUP_PROCESS execution ..');

DBMS_OUTPUT.PUT_LINE (
'Error Code:' || SQLCODE || ' Error Msg:' || SQLERRM);
END;

最佳答案

ORA-06550 错误是一个通用的 PL/SQL 编译错误。错误指向 PL/SQL 中发生语法错误的位置。请检查代码中的所有对象是否有效并尝试重新编译代码。从您的错误中我可以看出对象 DMQ1STG.CPS_SCHEDULE_SETUP_PROCESS 无效。

关于plsql - ORA-06550 : line 1, 第 7 列 : PLS-00905: object DMQ1STG. CPS_SCHEDULE_SETUP_PROCESS 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41165222/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com