1303
MySQLerrorstored-procedureshigh confidence

PROCEDURE uses a cursor — cannot use as a plain SELECT

Production Risk

Low — syntax error; query not executed.

What this means

A procedure that uses cursors was called in a context that expects a single result set, such as a subquery.

Why it happens
  1. 1Calling a cursor-using procedure as if it were a function or inline view
How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM (CALL my_cursor_proc()) t;

expected output

ERROR 1303 (0A000): PROCEDURE db.my_cursor_proc can't return a result set in the given context

Fix

Call the procedure separately

Call the procedure separately
CALL my_cursor_proc();

Why this works

Procedures must be called with CALL, not embedded in SELECT.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1303 ER_SP_BADSELECT

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

← All MySQL errors