How do I read a file with Informix 4GL?
Posted in 2007
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
What is the best way to read a flat file using Informix 4GL? Thanks
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.
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
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