Connection - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Connection

  

CreatePreparedStatement

  

create a Prepared Statement Module

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

connection:-CreatePreparedStatement( sql, opts )

Parameters

connection

-

Connection module

sql

-

string; the SQL statement to prepare

opts

-

(optional) equations of the form option=integer where option is one of timeout, maxrows or maxfieldsize

Description

• 

CreatePreparedStatement returns a PreparedStatement module.  This PreparedStatement module can be used to send a prepared SQL statement to the database. For information on prepared statements see the PreparedStatement page.

• 

CreatePreparedStatement accepts as optional arguments the same options that can be set with preparedstatement:-SetOptions.

  

timeout = integer

  

The number of seconds the client waits for a response from the database.

  

maxrows = integer

  

The maximum number of rows a query returns.

  

maxfieldsize = integer

  

The maximum number of bytes that a column uses to store character or binary data.  This only applies to columns of type BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR. If the limit is exceeded, then the extra data is ignored.

Examples

driverDatabase[LoadDriver]:

conndriver:-OpenConnectionurl,name,pass:

Create a statement with no options specified.

pstat1conn:-CreatePreparedStatement

stat1:=moduleoptionunload=Close;localhandle;exportExecute,NextResult,Close,SetOptions,GetOptions;end module

(1)

Create statements with various options.

pstat2conn:-CreatePreparedStatement'timeout'=10:pstat3conn:-CreatePreparedStatement'timeout'=5,'maxrows'=100:

See Also

Database

Database[Connection]

Database[Connection][CreateStatement]

Database[Connection][ExecuteQuery]

Database[Connection][ExecuteUpdate]

Database[PreparedStatement]

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