Disconnecting from the database – PB Docs 150
Disconnecting from the database When your database processing is completed, you disconnect from the database using the SQL DISCONNECT statement:
1 |
DISCONNECT; |
If you are using a Transaction object other than SQLCA, you must include the USING TransactionObject clause in the SQL syntax:
1 |
DISCONNECT USING <span>TransactionObject</span>; |
For example:
1 |
DISCONNECT USING ASETrans; |
Automatic COMMIT when disconnected When a transaction is disconnected,…
Using the Preview tab to connect in a PowerBuilder application – PB Docs 150
Using the Preview tab to connect in a PowerBuilder application The Preview tab page in the Database Profile Setup dialog box makes it easy to generate accurate PowerScript connection syntax in the development environment for use in your PowerBuilder application script. As you complete the Database Profile Setup dialog box, the correct PowerScript connection syntax…
Connecting to the database – PB Docs 150
Connecting to the database Once you establish the connection parameters by assigning values to the Transaction object properties, you can connect to the database using the SQL CONNECT statement:
1 |
// Transaction object values have been set. |
1 |
CONNECT; |
Because CONNECT is a SQL statement—not a PowerScript statement—you need to terminate it with a semicolon. If you are using a Transaction object other than…
Reading values from an external file – PB Docs 150
Reading values from an external file Using external files Often you want to set the Transaction object values from an external file. For example, you might want to retrieve values from your PowerBuilder initialization file when you are developing the application or from an application-specific initialization file when you distribute the application. ProfileString function You…
Assigning values to the Transaction object – PB Docs 150
Assigning values to the Transaction object Before you can use a default (SQLCA) or nondefault (user-defined) Transaction object, you must assign values to the Transaction object connection properties. To assign the values, use PowerScript dot notation. Example The following PowerScript statements assign values to the properties of SQLCA required to connect to a Sybase Adaptive…
The default Transaction object – PB Docs 150
The default Transaction object SQLCA Since most applications communicate with only one database, PowerBuilder provides a global default Transaction object called SQLCA (SQL Communications Area). PowerBuilder creates the Transaction object before the application’s Open event script executes. You can use PowerScript dot notation to reference the Transaction object in any script in your application. You…
Transaction basics – PB Docs 150
Transaction basics CONNECT and DISCONNECT A successful CONNECT starts a transaction, and a DISCONNECT terminates the transaction. All SQL statements that execute between the CONNECT and the DISCONNECT occur within the transaction. Before you issue a CONNECT statement, the Transaction object must exist and you must assign values to all Transaction object properties required to…
Finding examples – PB Docs 150
Finding examples If you are looking for ways to work with a specific PowerBuilder object class or feature, you can use the categories in the Examples pane and the descriptions to locate examples. If you are looking for examples using a specific event, function, or user-defined object, use the Search pane. To search for a…
Working with Transaction objects – PB Docs 150
Working with Transaction objects PowerBuilder uses a basic concept of database transaction processing called logical unit of work (LUW). LUW is synonymous with transaction. A transaction is a set of one or more SQL statements that forms an LUW. Within a transaction, all SQL statements must succeed or fail as one logical entity. There are…
Transaction object properties and supported PowerBuilder database interfaces – PB Docs 150
Transaction object properties and supported PowerBuilder database interfaces The Transaction object properties required to connect to the database are different for each PowerBuilder database interface. Except for SQLReturnData, the properties that return status information about the success or failure of a SQL statement apply to all PowerBuilder database interfaces. Table 12-2 lists each supported PowerBuilder…