Microsoft
Software
Hardware
Network
Question : SQL*Loader - Trim Leading & Trailing Space for Columns with Spaces in Name
I have a table to load raw data into. The data is comma delimited and enclosed in tics (single quotes).
The user has asked that I trim the trailing spaces from the data. No problem.
The problem is that the vendor who created the table has put spaces in the column names. This has been addressed and will be corrected however for now, we need to get the data into the table.
I am embryonic in using SQL*Loader and can't seem to get the syntax down for the columns with spaces.
Here are the column names:
PIN
ID NUMBER
NAME
COMMENT CODE
The data looks like:
'000352','555 ','JACK ','06 a p q t '
'000888','888 ','JILL ','10 z i q t '
Here is my control file:
LOAD DATA
INFILE 'datafile.dat'
INTO TABLE customer
REPLACE
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY "'"
TRAILING NULLCOLS
(
PIN "LTRIM(RTRIM(:PIN))",
"ID NUMBER",
NAME "LTRIM(RTRIM(:NAME))",
"COMMENT CODE"
)
What syntax can I use to trim the "ID NUMBER" and "COMMENT CODE"?
Answer : SQL*Loader - Trim Leading & Trailing Space for Columns with Spaces in Name
Try creating a view on the table with column_names "col_x" instead of "col x"
and check if you can use the view instead of the table in sql-loader
Random Solutions
Process of another computer
Regular Expression for Date format mm/dd/yyyy
Do I need OEM CDs to reinstall or will ActionPack CDs work? SBS 2003
Copy/Paste Relative to other column's number of rows
programmatically find WebappsClassLoader in tomcat
Read XML through oracle view and ordered output
Message getting stuck in deffered delivery
Change AD password via web
select * in view
aspnet, gridview.. Trimming the data in the bound controls