close()

Read(258) Label: close,

Here’s how to use close() function.

cs .close()

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:

cs.fetch()

db.cursor()

db .close()

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:

connect()

db.error()

db.commit()

db.rollback()

T.close()

Description:

Close a composite table.

Syntax:

T.close()

Note:

The function closes a composite table.

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