mariadb errno

From Onset Developer Wiki
mariadb errno

Type: Function
Context: Server
Introduced: v1.0

NOTICE

This function is provided by the official MariaDB plugin.

Description

Returns the error code of the error message from the previous MariaDB operation.

Syntax

mariadb_errno(handle_id)

Parameters

  • handle_id
    The mariaDB handle identifier.

Return Value

  • Error code, 0 if no errors occured.

Example

function UpdateVehicles()
    local query = mariadb_prepare(sql, "UPDATE vehicles SET owner = 0 WHERE model = 34;")
    mariadb_async_query(sql, query, OnUpdateVehicles)
end

function OnUpdateVehicles()
    local error_num  = mariadb_errno(sql)
    print("Error number: ", error_num )
end

See also