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

Updating data – PB Docs 2019 – PowerBuilder Library

Updating data – PB Docs 2019

Updating data

After users have made changes to data in a DataWindow control,
you can use the Update method to save those changes in the
database.

In PowerBuilder, the code looks like this:

Update sends to the database all inserts, changes, and deletions
made in the DataWindow control since the last Update method. When you
are using an external transaction object, you can then commit (or roll
back) those database updates. In PowerBuilder, you use SQL
statements.

For more specifics on how a DataWindow control updates the
database (that is, which SQL statements are sent in which situations),
see Updating the
database
.

Examples

The following example shows code that connects, retrieves,
updates, commits or rolls back, and disconnects from the
database.

Although the example shows all database operations in a single
script or function, most applications separate these operations. In a
PowerBuilder application, for example, an application could connect to
the database in the application Open event, retrieve and update data
in one or more window scripts, and disconnect from the database in the
application Close event.

PowerBuilder

The following statements retrieve and update data using the
transaction object EmpSQL and the DataWindow control dw_emp:

Handling retrieval or update
errors

A production application should include error tests after each
database operation. For more about checking for errors, see Handling DataWindow
errors
.


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