Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Loader 2 fields->1 field

Re: SQL*Loader 2 fields->1 field

From: Robert <rprendin_at_magi.com>
Date: 1997/09/30
Message-ID: <60ph9k$93p$1@news.istar.ca>#1/1

Load them as seperate columns into a temp table then do a concantenation and a to_date function to convert and insert them. It should look something like this...

insert into table1 select
to_date(col1date||','||col2time,'DD-MON-YY,HH24:MI') FROM TEMP_TABLE;

I just tried and i seems to work fine... here it is

SQL> CREATE TABLE TT2 (VTIME VARCHAR2(10),   2 V

SQL> 
SQL> 
SQL> CREATE TABLE TT2 (VDATE VARCHAR2(10),
  2 VTIME VARCHAR2(10)); Table created.

SQL> INSERT INTO TT2 VALUES ('01-JAN-97','18:10'); 1 row created.

SQL> CREATE TABLE TT3 (VDATE DATE); Table created.

SQL> insert into TT3
  2 select to_date(VDATE||','||VTIME,'DD-MON-YY,HH24:MI')   3 FROM TT2; 1 row created.

SQL> SELECT * FROM TT3; VDATE



01-JAN-97 SQL> SELECT TO_CHAR(VDATE,'DD/MM/YY,HH24:MI:SS') FROM TT3; TO_CHAR(VDATE,'DD/MM/YY,HH24:MI:SS')

01/01/97,18:10:00

cheers, Robert Prendin

Vincent Chang <vchang_at_impac.com> wrote:

>Hi, Everybody
> I am using SQL*Loader to load a flat text file data. I need to load
>2 fields (time and date) into 1 field in table (oracle datatype 'date'
>can hold these 2 info in 1 field). Any suggestion for this problem?
>Thanks.
 

>vincent
Received on Tue Sep 30 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US