Logging your work

As you work with your database, you generate SQL statements. As you define a new table, for example, PowerBuilder builds a SQL CREATE TABLE statement internally. When you save the table, PowerBuilder sends the SQL statement to the DBMS to create the table. Similarly, when you add an index, PowerBuilder builds a CREATE INDEX statement.

You can see all SQL generated in a Database painter session in the Activity Log view. You can also save this information to a file. This allows you to have a record of your work and makes it easy to duplicate the work if you need to create the same or similar tables in another database.

StepsTo start logging your work:

  1. Open the Database painter.

  2. Select Start Log from the Design menu or the pop-up menu in the Activity Log view.

    PowerBuilder begins sending all generated syntax to the Activity Log view.

StepsTo stop the log:

  1. Select Stop Log from the Design menu or the pop-up menu in the Activity Log view.

    PowerBuilder stops sending the generated syntax to the Activity Log view. Your work is no longer logged.

StepsTo save the log to a permanent text file:

  1. Select Save or Save As from the File menu.

  2. Name the file and click Save. The default file extension is SQL, but you can change that if you want to.

NoteSubmitting the log to your DBMS You can open a saved log file and submit it to your DBMS in the ISQL view. For more information, see “Building and executing SQL statements”.