Here’s how to use close() function.
Description:
Close a cursor.
Syntax:
cs.close()
Note:
The function clears the file handles and database connections used by cursors and their root cursors. By default, all of them will be closed automatically when fetch operation finishes.
Parameters:
cs |
A cursor |
Example:
|
A |
|
1 |
=demo.cursor("select * from SCORES") |
Return a cursor of retrieved data |
2 |
=A1.fetch(10) |
Retrieve some records |
3 |
=A1.close() |
Close the cursor |
Related functions:
Description:
Close a datasource connection.
Syntax:
db.close()
Note:
Close a database connection. By default, data will be committed before closing the database.
Parameters:
db |
Database connection |
Example:
|
A |
|
1 |
=connect("demo") |
|
2 |
>A1.close() |
Close the connection to database demo |
Note:
connect and close must be used in pairs; otherwise, the connection cannot be closed.
Related functions:
Description:
Close a composite table or a cluster table.
Syntax:
T.close()
Note:
The function closes a composite table or a cluster table. Clear up the memory when the table is a memory cluster table created by T.memory().
Parameters:
T |
A composite table. |
Example:
|
A |
|
1 |
=file("D:\\employee3.ctx") |
|
2 |
=A1.create() |
Open a composite table |
3 |
=A2.close() |
Close the composite table |
4 |
=file("dept.ctx":[1],["192.168.0.104:8281"]) |
|
5 |
=A4.create() |
Create a cluster table |
6 |
=A5.attach(t1) |
Return the attached table t1 already existing on the composite table |
7 |
=A5.memory(DEPTID,DEPTNAME;DEPTID<10) |
Generate a cluster memory table from t1 |
8 |
=A5.close() |
Close the cluster table and clear up memory |