How to LOAD selected columns from a delimited file?
Posted in 1997
Topics: General Discussion
I have searched the docs, but cannot find out how use the LOAD command
to insert selected columns from a delimited file. Example:
data.psv (input file)
-----------
ID|PRODUCT|VAL1|VAL2|VAL3
24|XYZ|1.2|3.4|5.6
columns in table "tests":
-------------------------
id
product
val1
val3
I want to do something like (%%bad syntax alert!%%):
load from "data.psv" columns(ID,PRODUCT,VAL1,VAL3) insert into tests
or
load from "data.psv" insert into tests(id,product,val1,NULL,val3)
or
load from "data.psv" insert into tests(id,product,val1,,val3)
The first one is bad syntax, and the last two fail when executed.
Is something like this possible, or do I have to strip the unwanted
columns from the input file first to make it match the table?
TIA,
--
Matt Reprogle
Delco Electronics - IC Integrated Manufacturing phone:(317)451-9651
mcreprog@koicew00.delcoelect.com FAX: (317)451-8230