当遇到以下情况之一时遇到符号“PROCEDURE”:(如果循环mod为空pragma raise返回选择更新,则使用<<继续关闭当前删除获取锁定插入打开回滚保存点的开始情况声明结束异常退出set sql execute commit forall merge pipe purge“declare”符号代替“PROCEDURE”继续。
PROCEDURE GETS_SO_ATS_INVALID_NOTIFY AS
FLAG VARCHAR2(100);
TRAMS_TOTAL_HOURS NUMBER(4);
ATS_TOTAL_HOURS NUMBER(4);
INVALID_MESSAGE VARCHAR2(100);
BEGIN
DECLARE
cursor TRAMS_CURSOR is
SELECT DISTINCT EMPLY_ID, FISCAL_YEAR, FISCAL_WEEK , DATE_ENTERED FROM GETS_SO_ATS_TRAMS_NEW_VIEW
where FISCAL_WEEK <>LNCURRENTFW
;
BEGIN
FOR trams_record IN TRAMS_CURSOR LOOP
TRAMS_TOTAL_HOURS := 0;
ATS_TOTAL_HOURS := 0;
END LOOP;
END;
PROCEDURE TRAMS_LAB_HOURs_UPLOAD AS
LSMAILBODY CLOB;
LSTOMAIL VARCHAR2(200);
LSMAILCC VARCHAR2(50);
LSSUBJECT VARCHAR2(100);
V_MAIL_ERROR VARCHAR2(100);
PNOUTFORECASTID VARCHAR2(38);
counter number(10);
BEGIN
counter:=1;
PNOUTFORECASTID:='mayank';
LSSUBJECT:='hello';
LSMAILBODY := '';
LSMAILBODY := LSMAILBODY ||
'<HTML><BODY ><FONT FACE=times roman SIZE=3>';
LSMAILBODY := LSMAILBODY ||'<table style="border-collapse:collapse;border-spacing:0"><tr>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, Helvetica, sans-serif !important;;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">EMPLOY</th>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">TRAMS</th>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">ATS</th>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">REASON</th>';
LSMAILBODY := LSMAILBODY || '</tr>';
FOR counter IN 1 .. 5 LOOP
LSMAILBODY := LSMAILBODY || '<tr>';
LSMAILBODY := LSMAILBODY || '<td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td><td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td><td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td><td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td></tr>';
END LOOP;
LSMAILBODY := LSMAILBODY || '</table>';
LSMAILBODY := LSMAILBODY || '</BODY></HTML>';
LSTOMAIL :='mayank.gandhi@ge.com';
V_MAIL_ERROR:='hello';
LSMAILCC:='hello';
ats_multi_email_clob(LSTOMAIL, LSSUBJECT, LSMAILBODY, LSMAILCC, V_MAIL_ERROR);
END;
END GETS_SO_ATS_TRAMS_PKG;
答案 0 :(得分:0)
错误的语法.. 首先,您必须在其中定义包,然后定义过程。 此外,对于每个开始块,都应该有一个'END'。
e.g。
CREATE OR REPLACE Pkg_test
PROCEDURE Proc_test(
)
IS
BEGIN
.... ..
END;
END Proc_test;
END Pkg_test;
答案 1 :(得分:0)
您错过了整个包装规格和正文。您可以在不使用包的情况下尝试这样做。
CREATE PROCEDURE GETS_SO_ATS_INVALID_NOTIFY
AS
FLAG VARCHAR2(100);
TRAMS_TOTAL_HOURS NUMBER(4);
ATS_TOTAL_HOURS NUMBER(4);
INVALID_MESSAGE VARCHAR2(100);
BEGIN
DECLARE
CURSOR TRAMS_CURSOR
IS
SELECT DISTINCT EMPLY_ID,
FISCAL_YEAR,
FISCAL_WEEK ,
DATE_ENTERED
FROM GETS_SO_ATS_TRAMS_NEW_VIEW
WHERE FISCAL_WEEK <>LNCURRENTFW ;
BEGIN
FOR trams_record IN TRAMS_CURSOR
LOOP
TRAMS_TOTAL_HOURS := 0;
ATS_TOTAL_HOURS := 0;
END LOOP;
END;
/
CREATE PROCEDURE TRAMS_LAB_HOURs_UPLOAD
AS
LSMAILBODY CLOB;
LSTOMAIL VARCHAR2(200);
LSMAILCC VARCHAR2(50);
LSSUBJECT VARCHAR2(100);
V_MAIL_ERROR VARCHAR2(100);
PNOUTFORECASTID VARCHAR2(38);
counter NUMBER(10);
BEGIN
counter :=1;
PNOUTFORECASTID:='mayank';
LSSUBJECT :='hello';
LSMAILBODY := '';
LSMAILBODY := LSMAILBODY || '<HTML><BODY ><FONT FACE=times roman SIZE=3>';
LSMAILBODY := LSMAILBODY ||'<table style="border-collapse:collapse;border-spacing:0"><tr>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, Helvetica, sans-serif !important;;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">EMPLOY</th>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">TRAMS</th>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">ATS</th>';
LSMAILBODY := LSMAILBODY || '<th style="font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#ffcb2f;color:#010066">REASON</th>';
LSMAILBODY := LSMAILBODY || '</tr>';
FOR counter IN 1 .. 5
LOOP
LSMAILBODY := LSMAILBODY || '<tr>';
LSMAILBODY := LSMAILBODY || '<td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td><td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td><td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td><td style="font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal">';
LSMAILBODY := LSMAILBODY || counter;
LSMAILBODY := LSMAILBODY || '</td></tr>';
END LOOP;
LSMAILBODY := LSMAILBODY || '</table>';
LSMAILBODY := LSMAILBODY || '</BODY></HTML>';
LSTOMAIL :='mayank.gandhi@ge.com';
V_MAIL_ERROR:='hello';
LSMAILCC :='hello';
ats_multi_email_clob(LSTOMAIL, LSSUBJECT, LSMAILBODY, LSMAILCC, V_MAIL_ERROR);
END;
/
答案 2 :(得分:-1)
这是由于使用了不正确的语法。检查链接http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6009.htm可能会帮助您找到正确的语法。