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

Error handling after a SQL statement – PB Docs 2022 – PowerBuilder Library

Error handling after a SQL statement – PB Docs 2022

Error handling after a SQL statement

When to check for errors

You should always test the success or failure code (the SQLCode
property of the Transaction object) after issuing one of the following
statements in a script:

  • Transaction management statement (such as CONNECT, COMMIT, and
    DISCONNECT)

  • Embedded or dynamic SQL

Not in DataWindows

Do not do this type of error checking following a retrieval or
update made in a DataWindow.

For information about handling errors in DataWindows, see the section called “Handling DataWindow errors” in DataWindow Programmers Guide.

SQLCode return values

The following table shows the SQLCode return values.

Value

Meaning

0

Success

100

Fetched row not found

-1

Error (the statement failed)

Use
SQLErrText or SQLDBCode to obtain the details.

Using SQLErrText and
SQLDBCode

The string SQLErrText in the Transaction object contains the
database vendor-supplied error message. The long named SQLDBCode in the
Transaction object contains the database vendor-supplied status code.
You can reference these variables in your script.

Example

To display a message box containing the DBMS error number and
message if the connection fails, code the following:


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