Icon STMTRESULT

Returns the result of the last statement execution (if available).

Syntax
STMTRESULT(<StatementName>)

<StatementName> =

Previously-executed statement

Returns
BOOLEAN

Usage
The STMTRESULT function returns the result of the execution of a given statement. Currently, only the VERIFY TABLE and REPAIR TABLE statements report a result, and each reports False if no errors were found during the verification or repair process.

Examples
-- This function returns whether any errors
-- were found when repairing the passed table name

CREATE FUNCTION RepairTable(IN TableName VARCHAR COLLATE ANSI_CI,
                            IN StructureOnly BOOLEAN)
RETURNS BOOLEAN
BEGIN
   DECLARE Stmt STATEMENT;

   PREPARE Stmt FROM 'REPAIR TABLE '+QUOTEDSTR(TableName,'"')+
     IF(StructureOnly,' STRUCTURE ONLY','');

   EXECUTE Stmt;

   RETURN STMTRESULT(Stmt);

END

SQL 2003 Standard Deviations
This function deviates from the SQL 2003 standard in the following ways:

DeviationDetails
ExtensionThis function is an ElevateDB extension.
Image