gpt4 book ai didi

plsqldeveloper - 在期望以下 : := . ( @ % ; 符号 "TABLE"TABLE"之一继续时遇到符号 ":= was inserted before "。

转载 作者:行者123 更新时间:2023-12-05 01:44:56 25 4
gpt4 key购买 nike

我写了一个函数,看起来一切正常,但我仍然遇到错误,

下面是我的函数:

create or replace FUNCTION TRANSFERQTYBTNDATES 
(
v_startDate IN DATE,
v_endDate IN DATE,
v_storeid IN NUMBER,
v_areaid IN NUMBER
)
RETURN TransferQtyBtnDates_pkg.tt_TransferQtyBtnDates_type PIPELINED
AS
v_temp SYS_REFCURSOR;
v_temp_1 TT_TRANSFERQTYBTNDATES%ROWTYPE;

BEGIN
TRUNCATE TABLE tt_TransferQtyBtnDates;

INSERT INTO tt_TransferQtyBtnDates
SELECT isb.ItemId ,
SUM(isb.Quantity) TransQty ,
isb.ExpiryDate TransExpDates
FROM Issues iss
JOIN IssuedBatches isb
ON iss.IssueRegisterId = isb.IssueRegisterId
WHERE iss.IssueType = 'TRANSFER ACCOUNT'
AND iss.IssuedDate BETWEEN v_startDate AND v_endDate
AND iss.AreaId = v_areaid
AND iss.StoreId = v_storeid
GROUP BY isb.ItemId,isb.Quantity,isb.ExpiryDate;

OPEN v_temp FOR
SELECT *
FROM tt_TransferQtyBtnDates;

LOOP
FETCH v_temp INTO v_temp_1;
EXIT WHEN v_temp%NOTFOUND;
PIPE ROW ( v_temp_1 );
END LOOP;
END;

在这方面我遇到了这些错误

Error(14,13): PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:     := . ( @ % ; The symbol ":= was inserted before "TABLE" to continue. 
Error(21,16): PLS-00103: Encountered the symbol "JOIN" when expecting one of the following: , ; return returning group having intersect minus start union where connect

请帮帮我...谢谢

最佳答案

使用以下 SQL 替换 DDL:立即执行“截断表 tt_TransferQtyBtnDates”;

关于plsqldeveloper - 在期望以下 : := . ( @ % ; 符号 "TABLE"TABLE"之一继续时遇到符号 ":= was inserted before "。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44047762/

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