Re: ace syntax
Posted in 1997
Billy Wheeler wrote: > > On 11 Jul 97 at 7:49, Pete Harris wrote: > > > I believe the more recent ace report writers allow you to read from > > an ascii file (as well as database tables). Could somebody remind me > > what the syntax is to do that? I would RTFM if I could find TFM. > > AFAIK, Ace doens't allow you to do any processing of the contents of > an ASCII file, it only allows you to print the contents of the file > using the imaginative PRINT FILE syntax. Not true, this changed in about 4.0 I think. The syntax is as follows: READ "filename" [DELIMITER "symbol"] [ORDER [EXTERNAL] BY columnlist] END The READ section replaces the normal SELECT section. The ORDER BY is, I think, a new thing, but I am not sure in which version. Probably version 6.x. Use the EXTERNAL keyword if the data is already sorted. You can only read a delimited file with each record terminated with a newline. You must include an ASCII definition in your DEFINE section to define the field names for the fields in the data file. The syntax is as follows: DEFINE ASCII fieldname_1 datatype, : fieldname_n datatype END Hope that helps, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //| | +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+