Tuesday, June 14, 2011

Creating a Database Table

You can create a new table in a database through the menu system, the Project Manager, or through the language. As you create the table, you can create long table and field names, default field values, field and record-level rules, as well as triggers.

To create a new database table
  • In the Project Manager, select a database, then Tables, and then New to open the Table Designer.
-or-
  • Use the CREATE TABLE command with a database open.
For example, the following code creates the table smalltbl with one column, called name:

OPEN DATABASE Sales
CREATE TABLE smalltbl (name c(50))

The new table is automatically associated with the database that is open at the time you create it. This association is defined by a backlink stored in the table’s header record.

No comments:

Post a Comment