Bind - 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]

  

Bind

  

bind value to a parameter in a prepared SQL statement

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Bind( statement, parameter, value, opts )

Parameters

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

Options

• 

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".

Description

• 

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.

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:

> 

Finalize⁡stmt:

> 

stmt≔Prepare⁡connection,SELECT * FROM test

stmt≔SQLite statement,SELECT * FROM test

(2)
> 

FetchAll⁡stmt

value 1

(3)
> 

Finalize⁡stmt:

> 

Close⁡connection:

Compatibility

• 

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]