Easysoft Blog

Mon, 25 March 2019

Salesforce API Query Cursor Limits

The Salesforce.com ODBC Driver uses the Salesforce API and is therefore subject to the limit that the API imposes on the number of query cursors that a user can have open.

A user can have up to 10 query cursors open at a time. If the same user (i.e. an application using a Salesforce ODBC data source that is configured to use a particular Salesforce account) attempts to open a new cursor, the oldest of the existing cursors is released. If the application attempts to open the released query cursor, an error is generated. (If you're using the Salesforce ODBC driver to connect SQL Server to Salesforce, you may get an "Unknown provider error" in these circumstances.)

In addition, query cursors are closed after 15 minutes of inactivity. For example, you run a query that results in the Salesforce API returning the first 200 rows in a table. If there are more rows, a query locator (cursor) passed back. If you do not ask for more rows within 15 minutes, Salesforce closes the query locator. If you then ask for more rows, an error will be returned.