Previous Topic Next topic Print topic


CHECKSINGLETON

Instructs OpenESQL to check if singleton SELECTs return more than one row when executed. If this is the case, OpenESQL returns SQLCODE -811. If NOCHECKSINGLETON is specified, OpenESQL returns SQLCODE 0.

Syntax:

[NO]CHECKSINGLETON

Properties:

Default: Returns SQLCODE +1

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.

When ANSI92ENTRY is specified and neither CHECKSINGLETON nor NOCHECKSINGLETON is specified (default), OpenESQL returns:
SQLCODE = -1 SQLSTATE = 21000 SQLWARN4 = W 
Depending on the status of CHECKSINGLETON and NOCHECKSINGLETON and the number of rows returned from the database, OpenESQL could return any of the following SQLDA diagnostics:
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.

Previous Topic Next topic Print topic