Database[SQLite]
ClearBindings
reset bindings in a prepared SQL statement
Calling Sequence
Parameters
Description
Examples
Compatibility
ClearBindings( statement )
statement
-
prepared SQL statement obtained using the Prepare command
The ClearBindings command resets value bindings for parameters in a prepared SQL statement.
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:
Execute statement again without clearing - the "value 1" is inserted
Reset⁡stmt
Clear bound value and bind a new one
ClearBindings⁡stmt
Bind⁡stmt,1,value 2
Finalize⁡stmt:
stmt≔Prepare⁡connection,SELECT * FROM test
stmt≔SQLite statement,SELECT * FROM test
FetchAll⁡stmt
value 1value 1value 2
Close⁡connection:
The Database[SQLite][ClearBindings] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
Database[SQLite][Bind]
Database[SQLite][Reset]
Download Help Document