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 FETCH NEXT – PB Docs 2019 – PowerBuilder Library

Microsoft SQL Server FETCH NEXT – PB Docs 2019

Microsoft
SQL Server FETCH NEXT

In the singleton SELECT, you specify variables to hold the values
for the columns within the selected row. The FETCH statement syntax is
similar to the syntax of the singleton SELECT. Values are returned INTO a
specified list of variables.

This example continues the previous example by retrieving some
data:

If at least one row can be retrieved, this FETCH places the values
of the emp_id and emp_name columns from the first row in the result set
into the PowerScript data variables emp_id_var and emp_name_var. Executing
another FETCH statement will place the variables from the next row into
specified variables.

FETCH statements typically occur in a loop that processes several
rows from a result set (one row at a time): fetch the row, process the
variables, and then fetch the next row.

What happens when the result set is
exhausted?

FETCH returns +100 (not found) in the SQLCode property within the
referenced transaction object. This is an informational return code; -1 in
SQLCode indicates an error.

See also

Microsoft SQL Server FETCH
NEXT

Microsoft SQL Server FETCH
FIRST, FETCH PRIOR, and FETCH LAST


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