Re: Can a 4GL program read an ASCII file?
Posted in 1994
Nick,
YOu can read an ascii file into a table or temporary table using the load
command:
load from "file_name"
insert into table name.
In the header-detail relationship you describe, the problem may be with
your definition of the table you load into. "Load" looks for column
delmiiters in the ascii file and expects there to be a column, null or
otherwise, for each column in each row you load. You might need to
define the ascii file in such a way that it is a single column to informix
and use a
temporary table with a single column to read in to. Once you have it in
the table you can determine whether it is header or detail information
and operate accordingly. (Never forget in the creation of a temporary
table, if you choose to use one, to create it with no logging.)
Good luck
--
Con Woodall Colorado St. U. | "Legal action brought against this
Veterinary Teach. Hosp. | man for unfortunate or malodorous
Ft. Collins CO 80523 | results of heeding his opinions will
303-491-1244 FAX 303-491-4414| be stoutly defended at the bar." Dewey,
cwoodall@vth1.vth.colostate.edu | Cheatham & Howe-Atts. to the Tappet Bros
--
On 14 Sep 1994, HoopsCraz wrote:
> I'm trying to create a process that will read in an ASCII file one record
> at a time and update appropriate tables based on a key. The ASCII file
> consists transaction headers that may have one or many detail lines
> following them.
>
> My question is this: Is it possible for a 4GL program to read directly
> from
> an ASCII file? I have looked briefly at using a C program, would this be
> the
> solution to choose, using PUSH and POP?
>
> Any suggestions would be appreciated.
>
> Nick Miles
> American Tire & Service (division of Bridgestone/Firestone)
> Rolling Meadows, IL
> email: hoopscraz@aol.com
>
>