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
PHP: Get values from strange format in string
How do I position a drawing canvas in MS Word 2010
Domain Controller Upgrade from 2003 to 2008
WS-X4448-GB-SFP setting MTU size per interface
Segregating Users Within SBS 2008
How do I reset the name of the "Title" column in Sharepoint after it has been renamed in error.
PERL Export to CSV
A substitute for Terminal Server running under 2003. Any 3rd party tool, having basic features of TS?
Cannot Open "Room Mailbox" Exchange 2010
The System Protection Tab is missing in Vista. How can I restore it?