Copy a table or column definition as text

From a meta-schema diagram, you can copy a table or a column and past the results in a Code Editor text document.

About this procedure

Using the copy-and-paste method, you can quickly add DEFINE statements to your source code.

When you copy a table, the DEFINE statement creates a record using the table name as part of the record variable name:
DEFINE t_orders RECORD LIKE orders.*
When you copy a column, the DEFINE statement creates a variable using the column name as part of the variable name:
DEFINE c_orderid LIKE orders.orderid
Before you begin:

You should have two documents open in the central work area: a text file displayed in Code Editor and a database meta-schema file displaying a diagram of tables and columns.

  1. Select the tab displaying the database meta-schema file.
  2. Right-click on a table or column, and select Copy from the context menu.
  3. Select the tab holding your text document in Code Editor.
  4. Place the cursor where you wish to insert the DEFINE statement, right-click and select Paste.
    The DEFINE statement is written to the text file.