Specifications
CHAPTER 3 Managing the Database
Users Guide 97
For SNC, use # for a local temporary table or ## for a global temporary table.
Temporary tables must start with the # character. Local temporary tables are
visible only in the user’s current connection and are deleted when the user
disconnects. Global temporary tables are visible to any user connected to the
instance of SQL Server, and they are deleted when all users referencing the
table disconnect.
Working with
temporary tables
After you create a temporary table, you can create indexes and a primary key
for the table from the pop-up menu for the table in the Object Layout view. If
you define a unique index or primary key, you can perform insert, update, and
delete operations in forms.
Selecting Edit Data from the pop-up menu of a temporary table retrieves data
that you store in that table. You can also select Drop Table, Add to Layout,
Export Syntax, and properties from the pop-up menu in the Objects view.
Working with keys
If your DBMS supports primary and foreign keys, you can work with the keys
in InfoMaker.
Why you should use
keys
If your DBMS supports them, you should use primary and foreign keys to
enforce the referential integrity of your database. That way you can rely on the
DBMS to make sure that only valid values are entered for certain columns.
For example, say you have two tables called
Department and Employee. The
Department table contains the column Dept_Head_ID, which holds the ID of the
department’s manager. You want to make sure that only valid employee IDs are
entered in this column. The only valid values for
Dept_Head_ID in the
Department table are values for Emp_ID in the Employee table.
To enforce this kind of relationship, you define a foreign key for
Dept_Head_ID
that points to the
Employee table. With this key in place, the DBMS disallows
any value for
Dept_Head_ID that does not match an Emp_ID in the Employee
table.
For more about primary and foreign keys, consult a book about relational
database design or your DBMS documentation.
What you can do in
the Database painter
You can work with keys in the following ways:
• Look at existing primary and foreign keys
• Open all tables that depend on a particular primary key