Connection - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Database Package : Connection : Database/Connection/ExecuteUpdate

Connection

  

ExecuteUpdate

  

execute a Single SQL Update

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

connection:-ExecuteUpdate( stat, opts )

Parameters

connection

-

Connection module

stat

-

string; the SQL update to execute

opts

-

(optional) equation of the form commit=name

Description

• 

ExecuteUpdate executes an SQL update over connection.  The SQL string stat must contain only a single SQL statement that performs an UPDATE, INSERT, or DELETE, or an SQL statement that returns nothing.  Passing any other statement to ExecuteUpdate is an error.

• 

The value returned by ExecuteUpdate is an integer representing the update count (the number of rows changed by the update).

• 

The opts argument can contain the following equation.

  

commit = true or false

  

By passing commit=true, Maple automatically calls Commit after executing the update. By default, there is no commit after the update is executed.

Examples

Query some data from the database.

driverDatabase[LoadDriver]:

conndriver:-OpenConnectionurl,name,pass:resultconn:-ExecuteQuerySELECT * FROM animals WHERE id > 10,'output'='Array':

(1)

c:-ExecuteUpdateINSERT INTO animals( id, name, number, mass ) VALUES( 11, 'chicken', 15, 2.1 )

1

(2)

c:-ExecuteUpdateINSERT INTO animals( id, name, number, mass ) VALUES( 12, 'cow', 2, 513 ),commit=true

1

(3)

c:-ExecuteQuerySELECT * FROM animals WHERE id > 10,output='Array'

11chicken152.1000000000000000812cow2513.

(4)

See Also

Database

Database[Connection]

Database[PreparedStatement]

Database[Result]

Database[Statement]

Database[usage]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam