Read in ACE
Posted in 2000
Topics: SQL Development & Query Writing, Stored Procedures & SPL
I have SE 7.20.UE2.
I have an ACE report project where I have to do a SELECT with 55
compares in the WHERE clause.
So I thought maybe I could put the 55 items in an ASCII file, READ them
into an ACE report program that would put them in a temporary file.
After all, there has got to be some reason for the READ statement in ACE.
So I have the ASCII statement in the DEFINE section then the following
READ statement followed by a SELECT statement:
READ "filename.txt" ORDER EXTERNAL BY fldone
INTO TEMP tmpfile;
#^
#
# A grammatical error has been found on line 59, character 1.
# The construct is not understandable in its context.
# See error number -8018
#
SELECT fld1, fld2, . . .
Line 59 is severl lines beyond the SELECT statement.
Error -8018 says:
A syntax error exists in the source file. A keyword might be misspelled
or misplaced in the file. Check the spelling of the keyword or the
sequence of control blocks within the report-specification file.
So should I assume I can't do the 'INTO TEMP tmpfile;' clause following
the READ statement and I have to do the 55 compares.
"Richard E. Hassler" wrote:
> I have SE 7.20.UE2.
SE 7.20 is not officially Y2K-compliant; you might need to upgrade.
ISQL 7.20 is OK, so you may be mixing the version of ISQL and the
version of SE.
> I have an ACE report project where I have to do a SELECT with 55
> compares in the WHERE clause.
Ouch.
> So I thought maybe I could put the 55 items in an ASCII file, READ them
> into an ACE report program that would put them in a temporary file.
Hmmm; I'm not sure how you are going to write the dynamic SQL; it is not
supported by ACE.
> After all, there has got to be some reason for the READ statement in ACE.
There is a reason for it, but this is not it.
The READ statement allows you to have some external data source create a
set of data in an UNLOAD format and then feed that data into an ACE
report, instead of using any SELECT statements. AFAIK, you cannot use
both READ and SELECT in a single report.
> So I have the ASCII statement in the DEFINE section then the following
> READ statement followed by a SELECT statement:
>
> READ "filename.txt" ORDER EXTERNAL BY fldone
> INTO TEMP tmpfile;
> #^
> #
> # A grammatical error has been found on line 59, character 1.
> # The construct is not understandable in its context.
> # See error number -8018
> #
>
> SELECT fld1, fld2, . . .>
> Line 59 is severl lines beyond the SELECT statement.
> Error -8018 says:
> A syntax error exists in the source file. A keyword might be misspelled
> or misplaced in the file. Check the spelling of the keyword or the
> sequence of control blocks within the report-specification file.
>
> So should I assume I can't do the 'INTO TEMP tmpfile;' clause following
> the READ statement
Yes.
> and I have to do the 55 compares.
Probably. How do those comparisons vary from run to run?
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"