我有这个 Oracle 程序:
CREATE OR REPLACE PROCEDURE xmas
IS
CURSOR curUser IS SELECT userID, coins FROM Users;
thisUser curUser%ROWTYPE;
d VARCHAR(7);
CURSOR curDate IS SELECT TO_CHAR(sysdate, 'DD-MON') FROM DUAL;
BEGIN
OPEN curDate;
FETCH curDate INTO d;
CLOSE curDate;
IF ((TO_DATE(d)) = (TO_DATE('25-DEC'))) THEN
OPEN curUser;
LOOP
FETCH curUser INTO thisUser;
EXIT WHEN (curUser%NOTFOUND);
thisUser.coins := thisUser.coins + 5.00;
UPDATE Users SET coins = thisUser.coins WHERE userID = thisUser.userID;
END LOOP;
CLOSE curUser;
END IF;
END xmas;
当我调用它时,我收到此错误:
ORA-01840: 输入值对于日期格式来说不够长。
尝试了几个小时的不同比较方法,但没有其他方法奏效。有什么问题??