next up previous contents index
Next: 11.7 Stabilizing your databases Up: 11 Schemas Previous: 11.5 Example Schemas

11.6 Adding new fields after data has been entered

Qddb allows you to add new attributes to existing schemas -- provided you add the attribute name to the tail of the schema or structured attribute.


If you add new fields to a schema, you must add the fields to the end of the schema, or structured attribute group.

For example, suppose you have the schema shown in figure 11.10



Name (
  First
  Last
)
Address (
  Street
  City
  State
)  

  
Figure 11.10: Sample schema before adding new attributes







Name (
  First
  Last
  Middle
)
Address (
  Street
  City
  State
  Zip
)  

  
Figure 11.11: Sample schema after adding new attributes to existing database





You could add the attributes ``Name.Middle'', but only if you put ``Name.Middle'' after ``Name.Last'' as shown in figure 11.11 Similarly, ``Address.Zip'' must be added at the end of the Address structured attribute as shown in figure 11.11

You can even add structured/expandable attributes to the end of schema files as shown in figure 11.12



Name (
  First
  Last
  Middle
)
Address (
  Street
  City
  State
  Zip
)  
Phone (
  Description
  Number
) *

  
Figure 11.12: Adding attributes to end of schema file for existing database





Notice how we added the structured/expandable attribute ``Phone'' to the tail of the Schema file.

Of course, if you have not stored any records yet, you can change the Schema however you like. If you have entered data and really cannot enter the fields at the end of the schema or structured attribute, you can always create new databases and then write Tcl scripts to copy the information from one database to another.

The only drawback to being forced to add attributes to the end of the schema (or structured attribute grouping) is that the attribute will be the last attribute in the nxqddb window. However, you can always write a short Fx-based Tcl program to layout your own screen. For details on how to program Fx/Qddb/Tcl applications, reference the Qddb Programming Guide.



Herrin Software Development, Inc.