stmt:bind_parameter_count

Returns the largest parameter index

Prototype

stmt:bind_parameter_count()

Description

Returns the largest statement parameter index in prepared statement stmt. When the statement parameters are of the forms ``:AAA'' or ``?'', then they are assigned sequentially increasing numbers beginning with one, so the value returned is the number of parameters. However if the same statement parameter name is used multiple times, each occurrence is given the same number, so the value returned is the number of unique statement parameter names.

If statement parameters of the form ``?NNN'' are used (where NNN is an integer) then there might be gaps in the numbering and the value returned by this interface is the index of the statement parameter with the largest index value.

Lua functions

Topics