Do Oracle VARCHAR2 types interpret any kind of escape sequences? I’m working with a system that has a UI that contains a date of birth field, but the DB saves it as a VARCHAR2. We’re seeing strange text in this field on the database side; letters such as “FF”, “B”, “EG” that seem inexplicable. The date field can take date values such as 8-AUG-2011 or lines of numbers such as 121234. These get converted into dates. The UI does not allow text such as “FF” or “EG” to be entered. So we’re a little confused as to how these are getting in the DB.
Has anyone seen a similar issue?
No,
VARCHAR2types do not include any sort of escape sequences.It sounds like the application you’re working with has some rather complicated logic that allows it to store dates as various sorts of character strings. The letters you’re seeing probably mean something to the application.
This is reason #136 that dates should always be stored in a
DATEcolumn and never in aVARCHAR2column. Otherwise, some enterprising developer along the way is going to decide that it makes sense to store some custom format masks in the data in order to solve some display issue which makes it difficult or impossible for anyone to update the data or to report on the data outside of this one particular application.