Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Tom asked how to read a flat file in Informix 4GL. Obnoxio The Clown and Hubert answered LOAD; Art Kagel said LOAD works for delimited files, otherwise C functions are needed (IIUG repository packages cfuncs, flat_4gl, 4gltools_ak). Ian Wilson described loading undelimited text into a single-column table using an unused delimiter and no empty lines.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Tom said:
> What is the best way to read a flat file using Informix 4GL?
LOAD
--
Bye now,
Obnoxio
"I'm astonished anyone pays real money for this crap."
-- Cosmo
--
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.
↪ replying to Tom
Art S. Kagel — — source: Usenet: comp.databases.informix
Tom wrote:
> What is the best way to read a flat file using Informix 4GL?
>
> Thanks
>
You can use the LOAD verb to load the contents into a database table if
the file is delimited. Other requirements, you have to get or write C
functions that are 4GL callable that will perform the IO for you. Check out
any or all of the following packages in the IIUG Software Repository to see
which fits your needs and philosophy:
Joe Huddleston's package: 'cfuncs'
The packages under the 'flat_4gl' label near the bottom of the 4GL page in
the Repository.
My printf-for-4GL functions in the package: 4gltools_ak
Art S. Kagel
↪ replying to Art S. Kagel
Ian Wilson — — source: Usenet: comp.databases.informix
Art S. Kagel wrote:
> Tom wrote:
>
>> What is the best way to read a flat file using Informix 4GL?
>>
>>
> You can use the LOAD verb to load the contents into a database table if
> the file is delimited.
I've used load where the file has no field delimiter, for example to
load a postscript report template into a table.
You have to
* Load into a single-column table.
* Specify a field delimiter that doesn't appear in the text file
* Ensure there are no zero-length lines in the file.
(i.e. "empty" lines must contain at least one space character)
Obviously, whilst the file has no field delimiter, it has a record
delimiter (\\n) but that's not what is usually meant by 'delimiter' in
the context of 'load'.
On Mar 8, 7:25 pm, "Tom" <thass...@gmail.com> wrote:
> What is the best way to read a flat file using Informix 4GL?
>
> Thanks
# file location '/unl/users.unl'
# table name 'users'
LOAD FROM "unl/users.unl" INSERT INTO users
regards
Hubert
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.