GetTrans – PB Docs 150

GetTrans method (DataWindows)

Description

Gets the values for the DataWindow control or DataStore object’s
internal transaction object and stores these values in the programmer-specified transaction
object.

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore
object

Syntax

[PowerBuilder]

Argument

Description

dwcontrol

A reference to a DataWindow control,
DataStore, or child DataWindow

transaction

The name of the transaction object into
which you want to put the values

Return Values

Returns 1 if it succeeds and –1 if an error occurs.
The return value is usually not used.

If any argument value is null, the method returns null.

Usage

The SetTrans method (not the SetTransObject method)
sets the internal transaction object. If you have not called SetTrans, GetTrans will
fail.

Use GetTrans when you want to get the values
for the transaction object in order to modify them, as shown in
the last example.

If you are using SetTransObject, which
specifies transaction information using a programmer-specified transaction
object, GetTrans will not report information
about the programmer-specified transaction object currently in effect.
(SetTransObject is the recommended connection
method because it gives better application performance. See SetTrans and SetTransObject for
more information.)

Examples

This example puts the values in the internal transaction
object for dw_employee into the programmer-specified transaction
object named object1:

The following statement puts the values in the internal
transaction object for dw_employee into the default transaction
object (SQLCA):

The following statements change the database type
and password of dw_employee. The first two statements create
the transaction object emp_TransObj. The next two statements
use the SetTrans method to set the values of SQLCA, and then use the GetTrans method
to store the values of the current transaction object for dw_employee
in emp_TransObj. The last two statements change the database
type and password, and then the SetTrans method
puts the revised values in the transaction object for dw_employee:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x