Re: SQL*Loader problem
Date: 1996/09/18
Message-ID: <bpuett-ya023080001809960221330001_at_news.interpath.net>#1/1
In article <323DB19D.3BBD_at_ny.ericsson.se>, Jan Eklöf
<ERAJEKF_at_ny.ericsson.se> wrote:
> Having trouble loading data into an oracle 7.1 db with SQLLOAD.
>
> The datafile to be loaded have a field with a numerical value which
> has 1 decimal (definition in oracle table: NUMBER(4, 1) ).
>
> In the datafile, the value is written in character form:
> 0110
> which is the value 11.0.
>
> How can I write the controlfile for SQLLOAD to make SQLLOAD
> understand that the last character in this field is a decimal ?
I would be real interested if someone else has a better answer ...
What I did was try to keep it simple:
- I left the value in character form and loaded it as is ...
- Then I went into SQL*Plus and did an "Update" on the table I had just loaded by dividing that field by 10, effectively shifting the decimal point over 1 place ... Since you can do a general update (i.e. without a Where Clause)
Update TABLE_A Set FIELD_A = FIELD_A / 10; This is a fairly easy solution ... If you already had data in the table, you would just need to add a WHERE clause to the above UPDATE that "narrowed" the Update to the few lines loaded (ex. Including a "Modified TimeStamp" field) ...
Hope this helps ... If anyone has a "cleaner" solution (ex. less steps),
plese let
us know ...
Received on Wed Sep 18 1996 - 00:00:00 CEST