When I try to execute this snippet:
cmd.CommandText = \"SELECT alarm_id,definition_description,element_id, TO_CHAR (alarm_datetime, \'YYYY-MM-DD HH24:MI:
The error means that you tried to enter a literal with a format string, but the length of the format string was not the same length as the literal.
One of these formats is incorrect:
TO_CHAR(t.alarm_datetime, 'YYYY-MM-DD HH24:MI:SS') TO_DATE(alarm_datetime, 'DD.MM.YYYY HH24:MI:SS')