Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
← Back to SQLCODE Reference
Error

SQLCODE -811

SELECT INTO returns multiple rows

Explanation

Multiple rows returned for SELECT INTO that expects one row.

Solution

Add WHERE clause to ensure single row, use cursor, or use MAX/MIN.

Example

SELECT INTO without unique predicate