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

FETCH – PB Docs 2019 – PowerBuilder Library

FETCH – PB Docs 2019

FETCH

SQL statement

Description

Fetches the row after the row on which Cursor | Procedure is
positioned.

Syntax

Parameter

Description

Cursor or Procedure

The name of the cursor or procedure from which you
want to fetch a row

HostVariableList

PowerScript variables into which data values will
be retrieved

Usage

The USING TransactionObject clause is not allowed with FETCH; the
transaction object was specified in the statement that declared the
cursor or procedure.

If your DBMS supports formats of FETCH other than the customary
(and default) FETCH NEXT, you can specify FETCH FIRST, FETCH PRIOR, or
FETCH LAST.

Error handling

It is good practice to test the success/failure code after
executing a FETCH statement. To see if the FETCH was successful, you
can test SLQCode for a failure code. However, if nothing matches the
WHERE clause and no rows are fetched, SQLCode is still set to 100. To
make sure the fetch affected at least one row, check the
SQLNRows property of the transaction object.

Examples

Example 1

This statement fetches data retrieved by the SELECT clause in the
declaration of the cursor named Emp_cur and puts it into Emp_num and
Emp_name:

Example 2

If sle_emp_num and sle_emp_name are SingleLineEdits, these
statements fetch from the cursor named Emp_cur, store the data in
Emp_num and Emp_name, and then convert Emp_num from an integer to a
string, and put them in sle_emp_num and sle_emp_name:


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