PG
PRO
22010ERRORTier 3 — Handle with care✅ HIGH confidence

invalid indicator parameter value

Category: Data ExceptionVersions: All Postgres versions

What this means

SQLSTATE 22010 is raised when an indicator parameter in embedded SQL (ECPG) has an invalid value. Indicator parameters communicate NULL status; a value other than -1 (NULL) or 0 (not NULL) is considered invalid.

Why it happens

  1. 1An indicator variable in ECPG has a value that is neither -1 (NULL indicator) nor 0 (not NULL)

How to reproduce

ECPG program setting an indicator variable to an invalid value.

trigger — this will ERROR
ERROR: invalid indicator parameter value

Fix 1: Set indicator variables to -1 (NULL) or 0 (not NULL) only

When using ECPG with indicator variables.

fix

Why this works

Follow the SQL standard: indicator = -1 to indicate NULL, indicator = 0 to indicate a non-NULL value.

Sources

📚 Official docs: https://www.postgresql.org/docs/current/errcodes-appendix.html

🔧 Source ref: Class 22 — Data Exception

Confidence assessment

✅ HIGH confidence

Standard SQLSTATE primarily relevant to ECPG embedded SQL. Rarely seen in application-level code.

See also

📄 Reference pages

ECPG — Embedded SQL in C
⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →