我已经使用此代码很长时间了,它工作正常:
to_char(v_emailRow.first_stamp, 'dd.mm.yyyy')
但是,今天我需要添加以下条件
case when v_cardCode = 'C1' then v_date else to_char(v_emailRow.first_stamp, 'dd.mm.yyyy') end。
一旦我添加了 case-then 语句,每当需要执行 to_char() 时,它就开始总是抛出ORA-01830: date format picture ends before converting entire input string错误。如果我删除 case-then,它会像往常一样工作,如果我将它添加回来,错误会立即返回。
我试过写一个测试脚本,谷歌搜索,但我找不到问题。两种情况下都转换了相同的值,为什么其中一种有效而另一种抛出错误?