Copying DBMS trace syntax from the Preview tab

One way to start Database Trace in a PowerBuilder application script is to copy the PowerScript DBMS trace 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, including Generate Trace. Therefore, copying the syntax directly from the Preview tab ensures that it is accurate in your script.

StepsTo copy DBMS trace syntax from the Preview tab into your script:

  1. On the Connection tab (or System tab in the case of OLE DB) in the Database Profile Setup dialog box for your connection, select the Generate Trace check box to turn on Database Trace.

    For instructions, see “Starting Database Trace in the development environment”.

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

  3. Click the Preview tab.

    The correct PowerScript connection syntax for the Generate Trace and other selected options displays in the Database Connection Syntax box.

  4. Select the SQLCA.DBMS line and any other syntax you want to copy to your script 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.