How to LOAD selected columns fro
Posted in 1997
You can't via "LOAD" but you can with "DBLOAD", use it! See Informix Guide to
SQL Reference Version 7.1, pages 5-23 to 5-49.
Hope this helps!
C.L. Kendricks
vnibs2@heb.com
--------------------------( Forwarded letter 1 follows )---------------------
Date: Tuesday, 25 March 1997 8:24pm
From: mcreprog@mail.delcoelect.com
Subject: How to LOAD selected columns from a delimited file?
Date:Tue, 25 Mar 1997 12:42:31 -0600
Reply-To: Matt Reprogle <mcreprog@mail.delcoelect.com>
Organization: Delco Electronics
Sender: informix-list-owner@rmy.emory.edu
To: informix-list@rmy.emory.edu
X-Informix-List-Id: <news.35788>
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