22010
PostgreSQLERRORCriticalData ExceptionHIGH confidence

invalid indicator parameter value

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.

expected output

ERROR:  invalid indicator parameter value

Fix

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

WHEN When using ECPG with indicator variables.

Why this works

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

Sources
Official documentation ↗

Class 22 — Data Exception

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All PostgreSQL errors