Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> combining 2 DATE columns
Hello,
I have a problem which, I believe, has 2 different solutions... I just don't know how to implement either of them!
I have a CSV flat file that I'd like to load into a table. Here's an example of the first 2 fields of this flat file:
01/07/2002,08:23:04, 01/07/2002,08:23:05, 01/07/2002,08:23:12, 01/07/2002,08:23:14, 01/07/2002,08:23:21, 01/07/2002,08:23:24, 01/07/2002,08:23:33, 01/07/2002,08:23:42, 01/07/2002,08:23:45, 01/07/2002,08:23:50,
Attached is how they currently look in my DB.
As you can see, they have separate "date" and "time" fields. I'd like to combine them into 1 DATE column in Oracle. What's the best way to do this, and how?
So far, I've tried concatenating them from SQL*Loader - but haven't had much luck on composing the right control file. My other option was to load them into a temp. table containing 2 DATE columns, and then concatenating them into 1 DATE column of the perm. table... but I can't figure out how to get rid of the extra "12:00:00" or "01/01/02." Is this even possible? I've played with TRIM & L/RTRIM but haven't had much luck... maybe it was just too late in the night. Or is there a magic function that does this that I don't know of??
Any suggestions greatly appreciated! Please let me know if you need me to clarify or provide more info.
TIA,
Verna
begin 666 dates.txt
M4U%,/B!S96QE8W0@*B!F<F]M(&YL<U]S97-S:6]N7W!A<F%M971E<G,[#0H- M"E!!4D%-151%4B @(" @(" @(" @(" @(" @(" @("!604Q512 @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0HM+2TM+2TM+2TM+2TMM+2TM+2TM+2TM+2TM+2TM+2T@+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @( T*3DQ37TQ!3D=504=%(" @(" @(" @(" @(" @ M(" @($%-15))0T%.(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" -"DY,4U]415)2251/4ED@(" @(" @(" @(" @(" @("!!345224-!(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0I.3%-?0U524D5. M0UD@(" @(" @(" @(" @(" @(" @)" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @( T*3DQ37TE33U]#55)214Y#62 @(" @(" @ M(" @(" @($%-15))0T$@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" -"DY,4U].54U%4DE#7T-(05)!0U1%4E,@(" @(" @(" N+" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0I.3%-?0T%, M14Y$05(@(" @(" @(" @(" @(" @(" @1U)%1T]224%.(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @( T*3DQ37T1!5$5?1D]234%4(" @(" @ M(" @(" @(" @($1$+4U/3BU24B @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" -"DY,4U]$051%7TQ!3D=504=%(" @(" @(" @(" @("!!3452 M24-!3B @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0I.3%-? M4T]25" @(" @(" @(" @(" @(" @(" @(" @0DE.05)9(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @( T*3DQ37U1)345?1D]234%4(" @ M(" @(" @(" @(" @($A(+DU)+E-36$9&($%-(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" -"DY,4U]424U%4U1!35!?1D]234%4(" @(" @(" @("!$ M1"U-3TXM4E(@2$@N34DN4U-81D8_at_04T@(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0I. M3%-?5$E-15]46E]&3U)-050@(" @(" @(" @(" @2$@N34DN4U-81D8_at_04T@ M5%I2(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @( T*3DQ37U1)34535$%-4%]4 M6E]&3U)-050@(" @(" @($1$+4U/3BU24B!(2"Y-22Y34UA&1B!!32!46E(@ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" -"DY,4U]$54%,7T-54E)%3D-9(" @(" @(" @(" @ M(" D(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M#0I.3%-?0T]-4" @(" @(" @(" @(" @(" @(" @(" @0DE.05)9(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @( T*3DQ37TQ%3D=42%]3 M14U!3E1)0U,@(" @(" @(" @($)95$4@(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" -"DY,4U].0TA!4E]#3TY67T580U @(" @(" @ M(" @("!&04Q312 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @#0H-"C$W(')O=W,@<V5L96-T960N#0H-"E-13#X@<V5L96-T('1D871E M+'1T:6UE(&9R;VT@=&EM:6YG<SL-"@T*5$1!5$4@(" @(%1424U%(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" -"BTM+2TM+2TM+2 M+2TM+2TM+2T@(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0HP-RU* M04XM,#(@,#$M2D%.+3 R(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @( T*,#<M2D%.+3 R(# Q+4I!3BTP M,B @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" -"C W+4I!3BTP,B P,2U*04XM,#(@(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0HP M-RU*04XM,#(@,#$M2D%.+3 R(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @M(" @(" @(" @(" @(" @(" @(" @(" @(" @( T*#0HN+BX-"@T*#0I344P^ M(&%L=&5R('-E<W-I;VX@<V5T(&YL<U]D871E7V9O<FUA=" ]("=M;2]D9"]R M<B!H:#IM:3IS<R<[#0H-"E-E<W-I;VX_at_86QT97)E9"X-"@T*4U%,/B!S96QE
M8W0@=&1A=&4L='1I;64_at_9G)O;2!T:6UI;F=S.PT*#0I41$%412 @(" @(" @ M(" @("!45$E-12 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @( T*+2TM+2TM+2TM+2TM+2TM+2T@+2TM+2TM+2TM M+2TM+2TM+2T@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" -"C Q+S W+S R(#$R.C P.C P(# Q+S Q+S R(# X.C(S.C T(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0HP,2\P-R\P,B Q M,CHP,#HP," P,2\P,2\P,B P.#HR,SHP-2 @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @( T*,#$O,#<O,#(@,3(Z,# Z,# @,#$O,#$O M,#(@,#@Z,C,Z,3(@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" -"C Q+S W+S R(#$R.C P.C P(# Q+S Q+S R(# X.C(S.C$T(" @M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @ M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @#0H-"BXN+@T* `