下面是經過3個輸入參數創建功能如何解決ORA-00933:SQL命令在oracle中沒有正確結束?
CREATE OR replace PACKAGE "PKG_CAMPAIGN_EMAIL_QTY"
AS
FUNCTION Getcampaignoutgoingemailqty(
tablename IN VARCHAR2,
ActivatedDate IN DATE,
CompletedDate IN DATE)
RETURN NUMBER;
END pkg_campaign_email_qty;
/
下面是該查詢得到計數
SELECT
(
pkg_campaign_email_qty.Getcampaignoutgoingemailqty(
9142632263013677974,
To_date('20/10/2015', 'DD/MM/YYYY'),
To_date('30/11/2015', 'DD/MM/YYYY')
)
) AS
email
FROM dual;
獲取ORA-00933軟件包:SQL命令未在Oracle
正確地結束這裏是包裝體
CREATE OR REPLACE PACKAGE BODY "PKG_CAMPAIGN_EMAIL_QTY" as
FUNCTION getCampaignOutgoingEmailQty(tableName IN VARCHAR2 ,ActivatedDate DATE,CompletedDate DATE) RETURN NUMBER IS
OutgoingEmailQuantity NUMBER;
begin
EXECUTE IMMEDIATE 'select NVL(COUNT(1),0) from campaign_'||tableName||'
join flat_interactions out_email on campaign_'||tableName||'.fullname=out_email.o_parent_id and out_email.N9135700037713613964=9135706250013621563 and out_email.D9135699928113613119 between TO_DATE(''ActivatedDate'',''MM/dd/YYYY'') and TO_DATE(''CompletedDate'',''MM/dd/YYYY'')' INTO OutgoingEmailQuantity;
RETURN OutgoingEmailQuantity ;
EXCEPTION
WHEN OTHERS THEN
RETURN 0;
end getCampaignOutgoingEmailQty;
end PKG_CAMPAIGN_EMAIL_QTY;
/
請你可以更新你的問題,以顯示Getcampaignoutgoingemailqty代碼(這將是在包體中)。 – Boneist
我沒有得到運行你的代碼的錯誤。我得到零,因爲你在包函數中壓縮的異常 - 當別人不這樣做時,不要使用'''''''''''''''''''''''' –
我沒有看到使用這麼差的異常處理程序的任何觀點。 –