I'm having this error on trying update my database trough Oracle.ManagedDataAccess.Client in C#. ORA-01830: date format picture ends before converting entire input string
I've already readed those posts:
ORA-01830: date format picture [duplicate] and ORA-01830: date format picture ends before converting entire input string / Select sum where date query
But they actually didn't work for me. When I ran this in SQL Navigator for Oracle in a Select, worked as a charm, but while calling to the update below from .Net it throws me this error.
update tbUser
set dt_inactive =
case
when trim(to_date(:dt_inactive, 'dd/mm/yyyy HH24:MI:SS')) is not null
then to_date(:dt_inactive, 'dd/mm/yyyy HH24:MI:SS')
else
to_date(dt_inactive, 'dd/mm/yyyy HH24:MI:SS')
end
where user_code = 'DEV01'
Debugging in Visual Studio, I've checked that the date comes like this: :dt_inactive = 30/01/2017 14:05:25, and that is exactly the format I want to send to to my database. However the error persists.
I've already tried to send this:
TO_DATE(:dt_inactive, 'dd/mm/yyyy HH:MI:SS') -- Throws me ORA-01849: hour must be between 1 and 12
TO_DATE(:dt_inactive, 'dd/mm/yyyy hh24:mi:ss')
TO_DATE(:dt_inactive, 'dd/mm/yyyy HH24:MI:SS')
TO_DATE(TO_CHAR(:dt_inactive), 'dd/mm/yyyy hh24:mi:ss')
TO_DATE(TO_CHAR(:dt_inactive), TO_CHAR('dd/mm/yyyy hh24:mi:ss'))
But nothing seem to work.
Create a procedure is not an option.
Any help would be appreciated.