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 write to hfsplus drive with journeling from linux?
Server 2003 SP2 in NT Domain
Cannot see all methods in a web service...
Acer 5720 TM new hard drive install says no partition available
SQL to find the previous dept of an employee
VB Script - Drop Shortcut on All User Deskop
Exchange and system state backup software for Windows 2008
data grid view format the boundfield to show as currency or as a date in c#
Out of Office not sending a reply
Script for reloading FreeRadius config files on NAS MySQL update