1414
MySQLerrorstored-procedureshigh confidence

OUT or INOUT argument is not a variable

Production Risk

Low — call fails; no data changed.

What this means

An OUT or INOUT parameter of a stored procedure was called with a literal or expression instead of a variable.

Why it happens
  1. 1Calling CALL my_proc(1, 100) where the second parameter is OUT
  2. 2Passing a constant expression to an OUT parameter
How to reproduce
trigger — this will error
trigger — this will error
CALL my_proc(@in_val, 100); -- 100 is a literal for an OUT param

expected output

ERROR 1414 (HY000): OUT or INOUT argument 2 for routine db.my_proc is not a variable or NEW pseudo-variable in BEFORE trigger

Fix

Pass a user variable

Pass a user variable
CALL my_proc(@in_val, @out_val); SELECT @out_val;

Why this works

OUT parameters must receive a variable that can be modified.

Sources
Official documentation ↗

MySQL 8.0 — 1414 ER_SP_NOT_VAR_ARG

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

← All MySQL errors