CREATE OR REPLACE PROCEDURE spSelPreSettleDate
(
v_TradeDate NUMBER,
v_SettleDay OUT NUMBER
)
AS
BEGIN
IF v_TradeDate IS NULL THEN
v_TradeDate:=HYHQ.BJT2UTC(SYSDATE);
SELECT NVL(SettleDay,0)
INTO
v_SettleDay
FROM SettleStatus a
WHERE a.SettleDay <v_TradeDate
AND a.Flag=0
AND ROWNUM=1
ORDER BY SettleDay DESC;
END IF;
END;
BJT2UTC 外部函数
报错
9/1 PLS-00363: expression 'V_TRADEDATE' cannot be used as an assignment target
9/1 PL/SQL: Statement ignored
指导下
------最佳解决方案--------------------
CREATE OR REPLACE PROCEDURE spSelPreSettleDate(v_TradeDate in out NUMBER, --定义成in out参数不就行了
v_SettleDay OUT NUMBER) AS
BEGIN
IF v_TradeDate IS NULL THEN
v_TradeDate := HYHQ.BJT2UTC(SYSDATE);
SELECT NVL(SettleDay, 0)
INTO v_SettleDay
FROM SettleStatus a
WHERE a.SettleDay < v_TradeDate
AND a.Flag = 0
AND ROWNUM = 1
ORDER BY SettleDay DESC;
END IF;
END;
------其他解决方案--------------------
不熟悉还是蛮可怕哦 谢了