我在使用此代码段时遇到问题:
DECLARE FormattedTimeStamp TIMESTAMP;
DECLARE pattern CHARACTER 'yyyy-mm-ddTHH:mm:ss';
SET FormattedTimeStamp = CAST(EnvRef.ConsumerTrxnsInq.paymentList[i].TransactionDate as DATE FORMAT 'yyyy-MM-dd');
SET OutputRoot.XMLNSC.ns:ConsumerTrxnsInqRs.Body.ConsumerTransaction[i].Timestamp = CAST(REPLACE(SUBSTRING(CAST(FormattedTimeStamp AS CHAR) before '.'),' ','T') AS TIMESTAMP FORMAT pattern);
当我运行它时,它会产生这个错误:
Error while casting. subParse failed. TIMESTAMPT'2014-12-02T15:39:21. yyyy-mm-ddTHH:mm:ss. TIMESTAMPT'2014-12-02T15:39:21. yyyy.
有什么帮助吗?