close a PreparedStatement module - Maple Help

Online Help

All Products    Maple    MapleSim

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

PreparedStatement:-Close - close a PreparedStatement module

Calling Sequence

preparedstat:-Close( )




PreparedStatement module



Close frees the resources associated with preparedstat. This happens automatically when preparedstat is garbage collected; however, you can call Close to release the resources immediately.


Any descendant modules of preparedstat are closed when preparedstat 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.)


Create a prepared statement, pstat.


conn:=driver:-OpenConnectionurl,name,pass:pstat:=conn:-CreatePreparedStatementSELECT * FROM animals:

Create a descendant of pstat.


Close pstat.


Try using pstat.

res:=pstat:-ExecuteSELECT * FROM animals:

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

Try to use pstat's descendant.


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

See Also

Database, Database[PreparedStatement], Database[PreparedStatement][Execute], 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