Database Administration (MOSC)

MOSC Banner

Strange behavior of TO_CHAR with DATE argument.

edited Jan 7, 2014 3:38AM in Database Administration (MOSC) 8 commentsAnswered
Hi all,

we have a table with attributes of the DATE type. When running an application, there seemed to be a problem with the values in these attributes.

I started  to investigate and found out that some of the values behaved strangely in that when TO_CHAR was applied to them, zero result was obtained:

SQL> select konecobdobi,dump(konecobdobi) from idb_pub.vyplacenenem

         where to_char(konecobdobi,'DD.MM.YYYY')='00.00.0000' and rownum<5;

17.11.2009   Typ=12 Len=7: 120,109,11,17,16,123,23

13.12.2009   Typ=12 Len=7: 120,109,12,13,16,123,23

29.11.2009   Typ=12 Len=7: 120,109,11,29,16,123,23

09.11.2009   Typ=12 Len=7: 120,109,11,9,16,123,23

What baffles me is the last but one value, 123, which should be the number of minutes and so less or equal to 59.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center