Re: How to LOAD selected columns fro
Posted in 1997
Matt Reprogle wrote:
>
> KENDRICKS.CHERYL@heb.com wrote:
> >
> > 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
>
> In my doc set (v7.2) there is no SQL Reference chapter 5. The only index reference to
> dbload is to SQL Tutorial 9-34, which points to the Informix Migration Guide, which I did
> not receive. I did get a book called Guide to the High Performance Loader, which looks
> like the proverbial sledgehammer to squash the mosquito.
>
> I'll keep looking.
>
> --
> Matthew C. Reprogle
> Delco Electronics - IC Integrated Manufacturing phone: (765)451-9651
> Internet: mcreprog@mail.delcoelect.com FAX: (765)451-8230
Matthew,
You are correct. In the V7.2 doc, the section on dbload is in the
Informix Migration Guide. In this chapter there are several examples
that would work for you based upon whether the data to be loaded was
delimited or fixed length, the columns you did not wish to load would
allow nulls or your plans were to fill these columns with a default
value (which of course can be accomplished several ways). A basic
example follows:
table "to_load"
col1 char(1) not null,
col2 date not null,
col3 integer not null,
col4 char(10)
file "to_load_from"
A|01/01/97|1|
B|02/02/97|2|
C|03/03/97|3|
dbload command file "do_part_load"
FILE to_load_from DELIMITER '|' 3;
INSERT INTO to_load (col1, col2, col3 )
VALUES (f01, f02, f03);
**** OR ****
dbload command file "do_part_load"
FILE to_load_from DELIMITER '|' 3;
INSERT INTO to_load (col1, col2, col3, col4 )
VALUES (f01, f02, f03, "TEXT" );
command line syntax:
dbload -d database_name -c do_part_load -l error_log_file
This should get you started.
Good luck!
Roger