Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Advice on date column?
bbristol_at_ix.netcom.com (Bruce Bristol ) wrote:
>
>I'm fairly new to my added DBA responsibilities and need some advice.
>
>I'm going to be adding, removing and possibly changing some columns on
>our tables. This affords me the opportunity to add century to a colum
>n
>that we currently have a yymmdd date stored in.
>
>The column's type is number(6).
>
>The data we'll always receive from our customer will be in the yymmdd
>format, even on/after 2000.
>
>For sorting purposes, I can increase the column to a number(8) and add
>the century in our programs, or perhaps an insert trigger.
>
>Should I do this, or just change the column type to 'date'? If I do
>change the column type to date, how do I make sure that programs can
>access it by yymmdd or even yyyymmdd?
>
>If access can still be by yymmdd, will oracle think 000101 is 1900 or
>2000?
>
>Thank you!
>
>-Bruce
Bruce,
Review Oracle documentation for the to_date / to_char functions. If you do not
use a date data type for the column, it does not make sense to ask if Oracle
will interpret it one way of another, the query will use to_char or to_date
functions to explicitly query the field. If you use a date data type, the
default format is DD-MON-YY, otherwise you use to_date / to_char functions to
convert the _matching_ to the format you need.
-- \\/// (0-0) +----oOO----(_)-----------+ | K. E. Fein | | Database Analyst | | kfein_at_primenet.com | | www.primenet.com\~kfein | +------------------oOO----+ | | | |__|__| || || ooO OooReceived on Mon Aug 11 1997 - 00:00:00 CDT
![]() |
![]() |