Format Mask for numbers in SQLLoader

I need to give a format mask for numbers in sqlloader
The csv file is cvariable record length and variable column length

Is it possible and how do I do it
mbergebyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

riazpkCommented:
Yes sure.

Here is an example:

LOAD DATA
INFILE *
INTO TABLE isnert_without_columns
replace
FIELDS TERMINATED BY X'9'
(OBJECT_TYPE,
OBJECT_NAME,
INSERT_STMT "upper(:INSERT_STMT)",  -- You will apply number format accordingly in the same way as done here.
TABLE_NAME,
FIX)
BEGINDATA
<Data>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mbergebyAuthor Commented:
Hi Riazpk
I have to ask you to be more specific
Is this an example or is it something I have to do before the actual loading
Can I use the actual column name instead of INSERT_STMT as in your example

0
mbergebyAuthor Commented:
Additional Info
The numbers are in the format 123.456.789 and sometimes 123.456
Fields terminated by ;
Data in a separate file which is defined by the infile parameter
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sapnamCommented:
For numbers without decimal values you use integer external
For numbers with decimal valies you use decimal external

like suppose my data is of 3 fields, Acct which is NUMBER(4) , DBCR VARCHAR2(1) and BAL NUMBER(13,2)

load data infile 'c:\temp\data.csv'
append into table my_table
fields terminated by ','
optionally enclosed by '"'
trailing nullcols
(acct   integer external,
 dbcr   char,
 bal     decimal external)

0
riazpkCommented:
Yes sure,

You will have to use your own column names and own function (to_number instead of upper).

That was just an example to show you that it works.
0
MikeOM_DBACommented:

Actually you may need to remove the commas:

load data infile 'c:\temp\data.csv'
append into table my_table
fields terminated by ','
optionally enclosed by '"'
trailing nullcols
(acct   integer external,
 dbcr   char,
 bal     decimal external "REPLACE(:BAL,',','')")
0
riazpkCommented:
Hi,
Any update on this? If your problem has been resolved, then please close this question.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.