Using dbload to populate VARCHAR fields
Posted in 1997
We are converting a Data Warehouse application from Oracle to
Informix 7.22. With Oracle we used SQL-Loader to populate the tables.
Informix's High-Performance Loader and dbload utilities seem to provide
functionality. However, we have been unable to determine a simple way
to trim trailing spaces from data being loaded into VARCHAR fields.
(Many of our tables contain fields which can be populated with
0 to 50 bytes of data. To reduce I/O we prefer to store this data
in VARCHAR fields. This data will not be modified after it is stored).
Over 100 different files from third party vendors and legacy systems
feed our data warehouse. Fields in these files are identified
by the column position. With Oracle's SQL-Loader trailing whitespace
was always trimmed from character input fields. Informix's dbload
utility does not have a similar capability or option.
For large data loads, we are considering:
* Loading data into a separate database and then
extracting the data in a column-delimited format for loading
into the production table (with dbload).
For smaller data loads, we are considering:
* Loading data into a separate database and then use SQL to
SELECT the data and INSERT it into the production tables.
i.e. INSERT INTO proddb:table1 (fld1, ...)
SELECT TRIM(fld1), ... from stagedb:table1 ...
Can anyone recommend an easier way to accomplish load these columns
without trailing whitespace?
Rick Bernstein Phone: (619) 458-7048
Alaris Medical Systems FAX: (619) 458-7640
San Diego, CA 92121 Internet: rbernste@alarismed.com