Re: unload and load in 4GL programs ?
Posted in 1996
It depends...
>From: "Ken McCoy" <KENM@apscn.k12.ar.us>
>Date: Mon, 21 Oct 1996 09:13:27 CST
>X-Informix-List-Id: <list.11812>
>
>What is the best way to perform
>"UNLOAD TO file SELECT * from table" and
>"LOAD FROM file insert into table" in a 4gl program.
>
>Do you build shell scripts to use these options or what?
If the name of 'table' is fixed, or one of a limited set of tables, then
you simply write the statement as shown. The file name can, and probably
should, be specified via a variable. On the other hand, if you need to
be able to choose which table to unload, then you need to be marginally
more sophisticated and create a string containing the select statement to
be used by the UNLOAD statement, and then use:
LET select_str = "SELECT * FROM ", tablename
UNLOAD TO file select_str
A similar technique can be used with LOAD.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>