Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Microsoft SQL Server Closing the cursor – PB Docs 150 – PowerBuilder Library

Microsoft SQL Server Closing the cursor – PB Docs 150

Microsoft SQL Server Closing the cursor

The CLOSE statement terminates
processing for the specified cursor. CLOSE releases resources associated
with the cursor, and subsequent references to that cursor are allowed
only if another OPEN is executed. Although you can have multiple
cursors open at the same time, you should close the cursors as soon
as possible for efficiency reasons.

In SQL Server, there is an additional reason to close cursors
as soon as possible. When an OPEN statement completes successfully,
there is a result pending for the current connection. FETCH statements
can be executed as long as there are rows in the result set to be
processed. However, as long as the result set is pending, no other
commands can be executed using the connection. To execute other
commands using the connection, you must release the result set by
closing the cursor.

Internally, PowerBuilder issues a DB-Lib dbcancel statement
when the cursor is closed. After the CLOSE has been executed, the
connection can be used for other SQL statements.

Example

This example illustrates the pending result set problem in
SQL Server. These statements use the cursor emp_curs to
retrieve rows from the employee table, then attempt to execute another
SQL statement while the cursor is open:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x