ORA-01858: 在 Oracle ADF 中需要数字的地方发现了非数字字符
ORA-01858: a non-numeric character was found where a numeric was expected in Oracle ADF
为什么我会通过 Java 应用程序针对此查询从 Oracle 收到上述 SQL 错误?
SELECT * FROM TestSchema.TestTable
WHERE userid = :userId
AND transactionDate BETWEEN TO_DATE(:start_date, 'yyyy-mm-dd')
AND TO_DATE(:end_date,'yyyy-mm-dd')
我明白了。在此示例中,start_date
和 end_date.
上不需要 to_date
函数这工作得很好:
SELECT * FROM TestSchema.TestTable
WHERE userid = :userId
AND transactionDate BETWEEN :start_date AND :end_date
为什么我会通过 Java 应用程序针对此查询从 Oracle 收到上述 SQL 错误?
SELECT * FROM TestSchema.TestTable
WHERE userid = :userId
AND transactionDate BETWEEN TO_DATE(:start_date, 'yyyy-mm-dd')
AND TO_DATE(:end_date,'yyyy-mm-dd')
我明白了。在此示例中,start_date
和 end_date.
上不需要 to_date
函数这工作得很好:
SELECT * FROM TestSchema.TestTable
WHERE userid = :userId
AND transactionDate BETWEEN :start_date AND :end_date