Copying AutoCommit and Lock syntax from the Preview tab

The easiest way to specify AutoCommit and Lock in a PowerBuilder application script is to copy the PowerScript syntax from the Preview tab in the Database Profile Setup dialog box into your script, modifying the default Transaction object name (SQLCA) if necessary.

As you complete the Database Profile Setup dialog box in the development environment, PowerBuilder generates the correct connection syntax on the Preview tab for each selected option. Therefore, copying the syntax directly from the Preview tab ensures that you use the correct PowerScript syntax in your script.

StepsTo copy AutoCommit and Lock syntax from the Preview tab into your script:

  1. On the Connection tab in the Database Profile Setup dialog box for your connection, supply values for AutoCommit and Lock (Isolation Level) as required.

    For instructions, see “Setting AutoCommit and Lock in the database profile”.

    For example, in addition to values for basic connection parameters (Server, Login ID, Password, and Database), the Connection tab for the following Adaptive Server profile named Sales shows nondefault settings for Isolation Level and AutoCommit Mode.

    For information about the DBParm parameters for your interface and the values to supply, click Help.

  2. Click Apply to save your changes to the current tab without closing the Database Profile Setup dialog box.

  3. Click the Preview tab.

    The correct PowerScript syntax for each selected option displays in the Database Connection Syntax box. For example:

    The sample shows the Preview tab page of the Database Profile Setup - Adaptive Server Enterprise displaying  Database Connection Syntax. Highlighted in the sample syntax are the lines Sequel C A dot Lock = " 3 " and Sequel C A dot Auto Commit = True.
  4. Select one or more lines of text in the Database Connection Syntax box and click Copy.

    PowerBuilder copies the selected text to the clipboard.

  5. Click OK to close the Database Profile Setup dialog box.

  6. Paste the selected text from the Preview tab into your script, modifying the default Transaction object name (SQLCA) if necessary.