Informix Error -35216: WHENEVER clause not allowed when SQLCODE appears in parameter list.
Cause and resolution
WHENEVER clause not allowed when SQLCODE appears in parameter list.
Choose either ANSI error handling with SQLCODE or Informix Ada-style error handling.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-35216 fires when a procedure with a SQLCODE parameter also uses a WHENEVER clause — per the
official guidance, these two error-handling styles are mutually exclusive.
- Both a
SQLCODEparameter and aWHENEVERclause present on the same procedure, per the official guidance — the direct, only cause.
Solutions / Resolution
- Choose either ANSI error handling with
SQLCODEor Informix Ada-style error handling, per the official guidance — not both.
Examples
N/A
No specific triggering statement is documented beyond a procedure combining SQLCODE and
WHENEVER.
Diagnostic Checks
- Check whether the procedure has both a
SQLCODEparameter and aWHENEVERclause, and remove one.
Related Errors / Related Topics
- -35219 — "At least one (SQLCODE) parameter required by ANSI X3.135-1989." The companion
ANSI requirement that makes
SQLCODEmandatory in the first place. - -35206 — "Language must be Ada, instead of language name." Related to the Ada-style error
handling this error treats as the alternative to
SQLCODE.
A procedure combined SQLCODE-based (ANSI) and WHENEVER-based (Ada-style) error handling —
these are mutually exclusive; choose one.