Click to See Complete Forum and Search --> : Insert . in flat file


aph
07-23-2002, 02:07 PM
Hi,
I have a flat file with the following format:
D58003704380000009168000006000020020626
D58003704380000009180000003145620020605
D58003704380000009182000000242320020603
D58003704380000009184000025700020020606
D58003704380000009186000021113420020603

I have to load into table, But before I load or during the load in to table I need to insert a DOT like '.' for e.g:
D5800370438000000916800000600.0020020626
D5800370438000000918000000314.5620020605
D5800370438000000918200000024.2320020603
D5800370438000000918400002570.0020020606
D5800370438000000918600002111.3420020603

Is there any way I can use some kind of format in sql*loader
Can any one help how I can get. The position of the dot is 30. The amount position is 22:32.

Thanks in advance,

stecal
07-23-2002, 02:47 PM
Insert the data into a dummy table using SQL Loader, then create your real table with

create table real_name as (select substr(string_in,1,29)||'.'||substr(string_in,30) data_string from dummy_table);

aph
07-23-2002, 05:09 PM
Thanks this is cool.

LKBrwn_DBA
07-23-2002, 07:46 PM
You could also code in your sql loader script something like this:


DOT_FIELD POS(??:??) "TO_NUMBER(:DOT_FILED)/100",

And not have to create a dummy table.