In a PowerBuilder database connection, a Transaction object is a special nonvisual object that functions as the communications area between a PowerBuilder application and the database. The Transaction object specifies the parameters that PowerBuilder uses to connect to a database. You must establish the Transaction object before you can access the database from your application, as shown in Figure 12-1:
Figure 12-1: Transaction object to access database
In order for a PowerBuilder application to display and manipulate data, the application must communicate with the database in which the data resides.
To communicate with the database from your PowerBuilder application:
Assign the appropriate values to the Transaction object.
Connect to the database.
Assign the Transaction object to the DataWindow control.
Perform the database processing.
Disconnect from the database.
For information about setting the Transaction object for a DataWindow control and using the DataWindow to retrieve and update data, see the DataWindow Programmer’s Guide.
When you start executing an application, PowerBuilder creates a global default Transaction object named SQLCA (SQL Communications Area). You can use this default Transaction object in your application or define additional Transaction objects if your application has multiple database connections.
Each Transaction object has 15 properties, of which:
Ten are used to connect to the database.
Five are used to receive status information from the database about the success or failure of each database operation. (These error-checking properties all begin with SQL.)