CHECKSINGLETON

Instructs OpenESQL to check if singleton SELECTs return more than one row when executed.

Syntax:

[NO]CHECKSINGLETON

Properties:

Default: None

Returns:

Directive SQLCODE returns SQLSTATE returns
None (default)* +1 21000
CHECKSINGLETON -811 21000
NOCHECKSINGLETON 0 21000
*When ANSI92ENTRY is specified without CHECKSINGLETON or NOCHECKSINGLETON (default), SQLCODE returns -1 and SQLSTATE returns 21000. See ANSI92ENTRY for additional details.

Scope:

Used at compile time: No
Behavior at run time: Process

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Comments:

  • CHECKSINGLETON is provided for DB2 compatibility.
  • NOCHECKSINGLETON is provided for applications that require SQLCODE 0.
  • For applications that require SQLCODE -1, specify ANSI92ENTRY without CHECKSINGLETON or NOCHECKSINGLETON.
  • OpenESQL returns the following SQLDA diagnostics when a singleton SELECT returns more than one row:
    SQLCODE SQLSTATE SQLWARN4 Flag
    -811 21000 W
    0 00000 space
    +1 21000 W
    -1 21000 W

    For more information, see SQLCODE Values, SQLSTATE Values, and The SQLCA Data Structure.