Skip to content

Creating a New Table

While Database Builder can be used to maintain tables, we recommend that you use the Studio to maintain tables during development.

To create a table, select New from the File menu or click the New Table button in the toolbar. The New Table dialog is activated, and you are prompted to enter the following information:

Table Name

Enter the name of your new table. This name should conform to your database's table name rules and should be unique for the current database.

Advanced

Click Advanced to edit more options for creating your new table. These options are normally defaulted to the database connection settings you have chosen for this database; however, they may be customized for each new table that you create.

For more information, refer to Configuring a Default Database Connection.

OK

Click the OK button to proceed. Database Builder will create a new table and activate the Table Editing dialog to allow you to set up columns, relationships, and indexes for the new table.

Cancel

Click the Cancel button to close this dialog without creating a new table.

Help

Click the Help button to display this information.

Advanced Options

Table Number

DataFlex’s file list uses a table number to address each table. Each data table in your application must have a unique table number within the supported range.

You are prompted with the lowest unused table number. You can accept the default or choose a different number. The table number determines the locking order for any group of tables that need to be locked, ensuring that tables are always locked in the same order.

Clicking the search icon on the right will increment the table number to the next highest unused table number.

File Name

If you are using the embedded database, the File Name refers to the directory name of the new table (excluding the file extension). Normally, this file name will be the same as the table name. The File Name must conform to operating-system filename rules.

Enter the File Name of the table you are creating. In certain cases, you may wish to enter a drive letter and path (up to a maximum of 40 characters in total). If you do not enter a drive and path, then the workspace Data path will be used to specify the table's location. Normally, you will not specify a drive letter or path.

If you are not using the embedded database, then the filename refers to the name of the file that records a description of the table to the database driver. Special modifiers can be added to the filename to specify the type of driver. Normally, you will not edit this field as it is better to accept the defaults that are entered for you in this dialog. Refer to your database driver documentation for specific information.

Recnum Table

Check Recnum Table if you want the new table to use DataFlex's legacy recnum system for maintaining a unique row identifier.

If you are not using the embedded database, then you should only use this option when the table will be used in a legacy DataFlex application that requires recnum support in each table. In all other cases, you will simply define a unique RowID using the primary key columns of your new table.

Embedded database tables must use Recnum support.

Database Type

This setting identifies the database system of the table. The default is determined by the default database connection settings for the current workspace. The combo list displays all installed database drivers. Choose one of the available database types.

Changing the Database Type will also change the text in the File Name and Connection String fields, as this information is automatically adjusted to conform to the selected database type.

To ensure that your desired database type is loaded for use in Database Builder, use the Configure Drivers option from the Tools menu.

To change the default database type, use the Configure Database Connection option from the Workspace menu.

Connection String

The Connection String is a set of property=value pairs that is used to establish a connection to your desired database. The particular set of property=value pairs is determined by the specific database that you are connecting to. Refer to your database driver documentation for specific details.

The embedded database does not use connection strings.

If your Pervasive database is not configured as a secured PSQL database, then you will not use a connection string.

You may click the icon to the right of this field to activate a special dialog to help you configure the connection string for your particular database. This is the recommended method of editing your connection string.

See Also