Statement - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Connectivity : Database Package : Statement : Database/Statement/Close

Statement

 Close
 close a Statement module

 Calling Sequence statement:-Close( )

Parameters

 statement - Statement module

Description

 • Close frees the resources associated with statement. This happens automatically when statement is garbage collected; however, you can call Close to release the resources immediately.
 • Any descendant modules of statement are closed when statement is closed.  (A module is a descendant of a parent module if it is returned by one of the parent module's exports or if it is a descendant of one of the parent module's descendants.)

Examples

Create a statement, stat.

 > $\mathrm{driver}≔{\mathrm{Database}}_{\mathrm{LoadDriver}}\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$$\mathrm{stat}≔\mathrm{conn}:-\mathrm{CreateStatement}\left(\right):$

Create a descendant of stat.

 > $\mathrm{res}≔\mathrm{stat}:-\mathrm{Execute}\left("SELECT * FROM animals"\right):$

Close stat.

 > $\mathrm{stat}:-\mathrm{Close}\left(\right)$

Try using stat.

 > $\mathrm{res}≔\mathrm{stat}:-\mathrm{Execute}\left("SELECT * FROM animals"\right):$

 Error, (in ExecuteQuery) this object has been closed, no further operations are possible

Try to use stat's descendant.

 > $\mathrm{res}:-\mathrm{Next}\left(\right)$

 Error, (in ExecuteQuery) this object has been closed, no further operations are possible

 See Also