Informix Error -8062: This report contains a SELECT statement, but a READ statement should be used instead because an ASCII record definition has be specified.
Cause and resolution
This report contains a SELECT statement, but a READ statement should be used instead because an ASCII record definition has be specified.
You can base a report on an ASCII file or on database rows, but not on both. The ASCII statement in the DEFINE section means that file input will be used, and a READ statement is used to read the file. If you want to base the report on database rows, retain the SELECT statement and delete the ASCII statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-8062 fires when a report has both a SELECT statement and an ASCII record
definition — per the official guidance, a report can be based on an ASCII file or on
database rows, but not both.
- An
ASCIIstatement present alongside aSELECTstatement, per the official guidance — the direct, only cause.
Solutions / Resolution
- If the report should be based on database rows, delete the
ASCIIstatement and keepSELECT, per the official guidance. - If the report should be based on the ASCII file, use
READinstead ofSELECT, per the official guidance.
Examples
An ASCII definition alongside SELECT
DEFINE
ASCII
order_id CHAR(10)
SELECT * FROM orders
Corrected (database-based)
SELECT * FROM orders
Diagnostic Checks
- Check the
DEFINEsection for anASCIIstatement, and decide whether the report is file-based (READ) or database-based (SELECT) — keep only the matching pair.
Related Errors / Related Topics
- -8061 — "This report contains a READ statement but no ASCII record definition has
been specified." The complementary condition —
READused without anASCIIdefinition.
A report has both SELECT and an ASCII definition — a report can be file-based or
database-based, not both.