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.
withDatabaseSQLite:
connection≔Open:memory::
Executeconnection,CREATE TABLE test (val):
stmt≔Prepareconnection,INSERT INTO test VALUES (?)
stmt≔SQLite statement,INSERT INTO test VALUES (?)
Bindstmt,1,value 1
Stepstmt:
Execute statement again without clearing - the "value 1" is inserted
Resetstmt
Clear bound value and bind a new one
ClearBindingsstmt
Bindstmt,1,value 2
Finalizestmt:
stmt≔Prepareconnection,SELECT * FROM test
stmt≔SQLite statement,SELECT * FROM test
FetchAllstmt
value 1value 1value 2
Closeconnection:
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