SQLNEXT

Fetches the next record in a multi-row query initiated with SQLCURSOR.

Supported Script Types

Generic Email Chat Phone Voicemail Work Item

Properties

TimeoutSec
The number of seconds until the query times out. The default is 10. The maximum number of seconds supported is 30 (though larger numbers can actually be entered in the field).

Branches

Default
While there are more rows to fetch, the Default branch condition will be triggered.
OnEndofDataset

Once the last row has been fetched, the next occurrence of SQLNEXT will trigger this condition.

Once triggered, the dataset will automatically be closed.

Always use SQLCLOSE before the end of the script.

Tips and Tricks

  • SQLNEXT does nothing if a query has not been opened with SQLCURSOR.
  • A LOOP action is typically used to repetitively call the SQLNEXT. As long as more data exists to fetch, the Default branch condition of the SQLNEXT will be triggered. The End Of Dataset branch condition will be triggered when SQLNEXT is executed and there are no remaining records.
  • If three records from a query were being fetched:
    • SQLCURSOR would fetch the first row.
    • Two iterations of SQLNEXT would retrieve the next two rows.
    • A third iteration would trigger the End Of Dataset branch condition off of the SQLNEXT action.