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: Loading from a column

Re: Loading from a column

From: Demetris <DMina_at_laiki.com>
Date: 10 Feb 2004 03:45:40 -0800
Message-ID: <c5285638.0402100345.275cee9@posting.google.com>


Thank all of you for the information you have provided me. It was very helpful!

Thanks again
D. M i n a

ed.prochak_at_magicinterface.com (Ed prochak) wrote in message news:<4b5394b2.0402051033.9bd3846_at_posting.google.com>...
> DMina_at_laiki.com (Demetris) wrote in message news:<c5285638.0402050340.3e482dc0_at_posting.google.com>...
> > Hello there!
> > I have a table (table1) and one of its columns DATA_X is CHAR(660)
> > I will create another table (table2) similar to the above but i will
> > replace the DATA_X column with several columns (different data types)
> >
> > The table1 is populated with data using a text file.
> > After the loading is finished on table1 i want to select all the data
> > from table1 and load it in table2. The DATA_X must be split in several
> > columns.
> >
> > How do i perform this?
> >
> > Thank you.
>
> Use the various String functions to split that data according to your needs.
> for example
>
> table1
> keyid number
> data_x char(660)
>
> table2
> keyid number
> datapart1 number
> datapart2 varchar(100)
>
> insert into table2 (keyid, datapart1, datapart2) values
> ( select keyid, to_num(substr(data_x,1,10)), ltrim(substr(data_x,50,100))
> from table1 ) ;
>
> My syntax may be off, but you get the idea.
>
> More complex conversions will require PL/SQL or other programming language.
Received on Tue Feb 10 2004 - 05:45:40 CST

Original text of this message

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