Home Contents | # sql:lastError | Sql | Core4 Lua Commands

## SYNOPSIS

1. text, code = query:lastError()
2. query:clearError()

## DESCRIPTION

When any of the other functions working on a database or query handle indicates an error condition, the error is stored inside the handle and can be retrieved by calling sql:lastError().

When the error has been handled by the application, it can be cleared by calling clearError().

## RETURN VALUE

If an error has been stored, returns two values. A string describing the error and a numeric error code. Both values are retrieved from the database engine.

If no error has been stored, returns nil.