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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL Loader and decimals

RE: SQL Loader and decimals

From: Gustavo Coria <gcoria_at_bcp.com.pe>
Date: Tue, 12 Mar 2002 12:24:04 -0800
Message-ID: <F001.004260C1.20020312122404@fatcity.com>


Hi Witold :

        You should, to create an function "divide" : divide(12345/100) result = 123.45
In ControlFile you should include the following sentence :

LOAD DATA
TRUNCATE
PRESERVE BLANKS
INTO TABLE TABLENAME
(

FIELD1		POSITION (1:20) CHAR,
FIELD2		POSITION (21:21) DECIMAL EXTERNAL,
FIELD3		FILLER  POSITION (22:26) DECIMAL EXTERNAL,
FIELD4		"DIVIDE(:FIELD3)"

)

-----Original Message-----
Sent: Tuesday, March 12, 2002 02:42 PM
To: Multiple recipients of list ORACLE-L

Hello

There are few numeric formats when you load data from a file. I am looking for a way, if possible, to load a number from a field that doesn't have the decimal point.
For example I may know that in my five-character field the first three characters always represent the most-significant digits and the last two are always the decimal values. Something like:

field 12345
would be loaded as 123.45

If, in data file, I have the value 123.45 I can use decimal external but wonder if I can avoid the decimal point in datafile. How can I define the field in control file?

Thanks

Witold



Witold Iwaniec
Sr Software Developer
NovaLIS Technologies
wiwaniec_at_novalistech.com
http://www.novalistech.com

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Witold Iwaniec
  INET: wiwaniec_at_novalistech.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Gustavo Coria
  INET: gcoria_at_bcp.com.pe
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Mar 12 2002 - 14:24:04 CST

Original text of this message

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