DataInterfaceStream - Maple Programming Help

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

DataInterfaceStream

 Close
 close a DataInterfaceStream Module

 Calling Sequence stream:-Close( )

Parameters

 stream - DataInterfaceStream module

Description

 • Close is used to close a DataInterfaceStream module. This happens automatically when this object is garbage collected; however, you can call Close to release the resources earlier.
 • Any descendant modules of stream are closed when stream 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

 > $\mathrm{driver}≔\mathrm{Database}\left[\mathrm{LoadDriver}\right]\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$$\mathrm{res}≔\mathrm{conn}:-\mathrm{ExecuteQuery}\left("SELECT * FROM stream"\right):$$\mathrm{res}:-\mathrm{Next}\left(\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{str}≔\mathrm{res}:-\mathrm{GetData}\left(1,\mathrm{stream}=\mathrm{true}\right):$$\mathrm{str}:-\mathrm{Read}\left(10\right)$
 ${"the quick"}$ (2)
 > $\mathrm{str}:-\mathrm{Close}\left(\right);$$\mathrm{str}:-\mathrm{Read}\left(10\right)$

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