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
how to add user local profile with connect computer wizard, SBS 2008
How would I script the adding of a network printer to an XP client based on the the Computer's name?
Dual Boot Windows XP and 7 Upgrade
size of listbox html
How could I select and sum a table from a range of fields?
Reset password MD3000i?
Using Key Management Services for WS 2008 in an SBS 2003 environment.
PowerShell Scripting Error
Getting root URL in C#
stsadm import command fails to execute