DM***@laiki.com (Demetris) wrote in message news:<c5**************************@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.