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

OLE DB EXECUTE – PB Docs 2021 – PowerBuilder Library

OLE DB EXECUTE – PB Docs 2021

OLE DB
EXECUTE

Database stored procedures that perform only updates and do not
return a result set are handled in much the same way as procedures that
return a result set. The only difference is that after the EXECUTE
procedure_name statement executes, no result set is pending, so a CLOSE
statement is not required.

Using the SQLCode property

If a specific procedure can never return a result set, only the
EXECUTE statement is required. If a procedure may or may not return a
result set, you can test the SQLCode property of the referenced
transaction object for +100 (the code for NOT FOUND) after the
EXECUTE.

The possible values for SQLCode after an EXECUTE are:

Return code

Means

0

The EXECUTE was successful and a result set is
pending. Regardless of the number of FETCH statements executed,
the procedure must be explicitly closed with a CLOSE
statement.

This code is returned even if the result
set is empty.

+100

Fetched row not found.

-1

The EXECUTE was not successful and no result set was
returned.

Example 1

This example illustrates how to execute a stored procedure that does
not return a result set. It assumes the default transaction object (SQLCA)
has been assigned valid values and a successful CONNECT has been
executed.

Error checking

Although you should test the SQLCode after every SQL statement,
these examples show statements to test the SQLCode only to illustrate a
specific point.

Example 2

This example illustrates how to pass parameters to a database stored
procedure. It assumes the default transaction object (SQLCA) has been
assigned valid values and a successful CONNECT has been executed.
Emp_id_var was set to 691 elsewhere.


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