Informix Error -9068: An SQL statement has been found in the SELECT section that is not a SELECT statement. Only SELECT statements or SELECT statements that create temporary tables are allowed in the SELECT section.
Cause and resolution
An SQL statement has been found in the SELECT section that is not a SELECT statement. Only SELECT statements or SELECT statements that create temporary tables are allowed in the SELECT section.
Possibly the word SELECT is misspelled in the report specification. If you intentionally wrote another SQL statement such as UPDATE or INSERT, remove it; only SELECT statements are permitted in reports. (You can execute other SQL statements in a C function that is called from a report. The ESQL/C manual discusses linking external C functions with reports.)
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9068 fires when a non-SELECT SQL statement appears in the report's SELECT section — per the official guidance.
- A misspelled SELECT keyword, per the official guidance — the first named cause.
- An intentionally included non-SELECT statement, such as UPDATE or INSERT, per the official guidance — the second named cause; only SELECT statements are permitted there.
Solutions / Resolution
- Check whether SELECT is misspelled, per the official guidance.
- Remove any non-SELECT statement from the SELECT section, per the official guidance — only SELECT statements are permitted.
- Execute other SQL statements from a C function called by the report instead, per the official guidance, per the ESQL/C manual's discussion of linking external C functions with reports.
Examples
An UPDATE statement in the SELECT section
SELECT section
UPDATE customer SET status = 'active' -- -9068: not a SELECT statement
END
Corrected
SELECT section
SELECT * FROM customer WHERE status = 'active'
END
Diagnostic Checks
- Review each statement in the SELECT section, and remove or correct any that isn't a SELECT statement.
Related Errors / Related Topics
- -9059 — "A select statement which is not the final select statement in an ACE report must select into a temporary table." A related SELECT-section validity error, on INTO TEMP usage rather than statement type.
- -9061 — "A 'SELECT INTO' statement cannot be executed as the last select statement in an ACE report." A related SELECT-section validity error, on INTO TEMP usage rather than statement type.
A non-SELECT SQL statement was found in the SELECT section — only SELECT statements are permitted there.