我在 Oracle 中有一个问题,有一个虚拟列(我需要从日期列开始的时间戳);这是我的例子:
CREATE TABLE TBDATETIME(
DATETIME_1 DATE,
DATETIME_2 TIMESTAMP(9) GENERATED ALWAYS AS (
CAST( TO_CHAR(DATETIME_1, 'DD/MM/YYYY HH24:MI:SS')
|| '.' || TO_CHAR(DATETIME_1, 'FF9') AS TIMESTAMP(9))
) VIRTUAL
);
INSERT INTO TBDATETIME(DATETIME_1)
VALUES(SYSDATE);
COMMIT;
SELECT *
FROM TBDATETIME;
ORA-01821: date format not recognized
01821. 00000 - "date format not recognized"
*Cause:
*Action:
获取数据的问题在哪里?我尝试了很多格式掩码,但没有任何帮助......