Database[SQLite]
Bind
bind value to a parameter in a prepared SQL statement
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Bind( statement, parameter, value, opts )
statement
-
prepared SQL statement obtained using the Prepare command
parameter
posint; index of the SQL parameter
value
value to be assigned
opts
(optional) equation(s) of the form option = value; specify options for the Bind command
valuetype = string
The valuetype option specifies the type of the value. It may be one of the strings "auto", "blob", "float", "integer", or "text". See the Database[SQLite] help page for more information about type conversion between SQLite and Maple. The default is "auto".
The Bind command resets value bindings for parameters in a prepared SQL statement.
parameter is the index of the SQL parameter to be set. The leftmost SQL parameter has an index of 1.
with⁡DatabaseSQLite:
connection≔Open⁡:memory::
Execute⁡connection,CREATE TABLE test (val):
stmt≔Prepare⁡connection,INSERT INTO test VALUES (?)
stmt≔SQLite statement,INSERT INTO test VALUES (?)
Bind⁡stmt,1,value 1
Step⁡stmt:
Finalize⁡stmt:
stmt≔Prepare⁡connection,SELECT * FROM test
stmt≔SQLite statement,SELECT * FROM test
FetchAll⁡stmt
value 1
Close⁡connection:
The Database[SQLite][Bind] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
Database[SQLite][ClearBindings]
Download Help Document