ClearBindings - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Database[SQLite]

  

ClearBindings

  

reset bindings in a prepared SQL statement

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

ClearBindings( statement )

Parameters

statement

-

prepared SQL statement obtained using the Prepare command

Description

• 

The ClearBindings command resets value bindings for parameters in a prepared SQL statement.

Examples

> 

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 (?)

(1)
> 

Bind⁡stmt,1,value 1

> 

Step⁡stmt:

Execute statement again without clearing - the "value 1" is inserted

> 

Reset⁡stmt

> 

Step⁡stmt:

> 

Reset⁡stmt

Clear bound value and bind a new one

> 

ClearBindings⁡stmt

> 

Bind⁡stmt,1,value 2

> 

Step⁡stmt:

> 

Finalize⁡stmt:

> 

stmt≔Prepare⁡connection,SELECT * FROM test

stmt≔SQLite statement,SELECT * FROM test

(2)
> 

FetchAll⁡stmt

value 1value 1value 2

(3)
> 

Finalize⁡stmt:

> 

Close⁡connection:

Compatibility

• 

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]