Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to load fields with decimal values using SQL Loader?

JulaayiAug 28 2014 — edited Aug 28 2014

Hello everyone,

I'm trying to load a data file into the database table using sqlldr. However, I couldn't load the decimal field values properly into the table. Could someone please help me with this?

Here is the DDL of the table:

CREATE TABLE Product_Sales(

    Year_of_Sale NUMBER,

    Product_Type VARCHAR2(25 CHAR),

    Product_Group VARCHAR2(25 CHAR),

    Category_Type VARCHAR2(25 CHAR),

    Category_Group VARCHAR2(10 CHAR),

    Product_Count NUMBER,

    Product_Amount NUMBER(19,2),

    Category_Count NUMBER,

    Category_Amount NUMBER(19,2)

)

Data in the data file:

2010     'Online'     'Web'     'Cameras'     'Electronics'     547     0.00     0     0.00

When I load the above data into the table, I see the data as:

2010 Online Web Cameras Electronics 547 0 0 0

Its ignoring the values after decimals.

Here is how my control file looks like:

LOAD DATA

INFILE 'C:\Julaayi\Yearly_Sales.dat'

TRUNCATE INTO TABLE PRODUCT_SALES

FIELDS TERMINATED BY '\t'

(

    Year_of_Sale,

    Product_Type,

    Product_Group,

    Category_Type,

    Category_Group,

    Product_Count,

    Product_Amount,

    Category_Count,

    Category_Amount

)

Thanks,

Julaayi

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2014
Added on Aug 28 2014
1 comment
1,288 views