Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

-302

Input variable or parameter invalid or too largeNEGATIVE SQLCODE · CHECKED 2026-11-14
Checked against IBM documentation

A host variable or parameter value is invalid or too large for the column or target value it is assigned to.

QUICK ANSWER

A host variable or parameter value is invalid or too large for the column or target value it is assigned to.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. A string host variable or parameter is longer than the target column.
  2. A numeric value is too large for the column definition.
  3. A decimal host variable contains invalid decimal data.
  4. A string or number is too large for a constant target value.

CHECKED 14 Nov 2026 IBM: Db2 13 for z/OS: SQLCODE -302 (Db2 for z/OS 13.0.0)

TRY IT: RECORD DECODER ▸

MOST LIKELY

A string host variable or parameter is longer than the target column.

FIRST CHECK

Find the host variable or parameter by its position number.

TRY IT ▸

Record decoder

What it means

The message gives the position number of the host variable (or the parameter number for CALL or a function). SQLSTATE is 22003 when a number is too large for the target and 22001 otherwise.

IBM lists the causes: strings or numbers too large for a column or constant target, and invalid decimal data in a decimal host variable.

Typical causes

  • A string host variable or parameter is longer than the target column.
  • A numeric value is too large for the column definition.
  • A decimal host variable contains invalid decimal data.
  • A string or number is too large for a constant target value.

How to fix it

  1. Find the host variable or parameter by its position number.
  2. Check the column type and length against the variable's data type and contents.
  3. Make sure the value fits, and that decimal data is valid System/370 packed decimal.
  4. Correct the application program, function or stored procedure.