An NDB cannot be used without field definitions. Field definitions can be added to or deleted from an NDB, using the NDB FIELD command at any time. Just after the successful completion of an NDB CREATE followed by an NDB START is a good time to add field definitions.
Example: Insert Field Definitions
The following example shows how to add field definitions:
NDB FIELDdbname ADD=SURNAMEFMT=C KEY=Y + NULLFIELD=N NULLVALUE=N NDB FIELDdbname ADD=FIRSTNAMEFMT=C KEY=N NDB FIELDdbname ADD=DOBFMT=D KEY=N NDB FIELDdbname ADD=ADDR1FMT=C KEY=N NDB FIELDdbname ADD=ADDR2FMT=C KEY=N NDB FIELDdbname ADD=ADDR3FMT=C KEY=N NDB FIELDdbname ADD=ADDR4FMT=C KEY=N NDB FIELDdbname ADD=SEXFMT=C KEY=N NDB FIELDdbname ADD=NAME
Note: The definitions could also have been added by using the &NDBDEF verb.
If the database is to have a sequence key, then the definition for it must be added first. A sequence key is defined by specifying KEY=SEQUENCE (can be abbreviated to KEY=S) on the field definition. A sequence key is forced to have the attributes UPDATE=NO, and NULLFIELD=NO. Records must always have a unique value for the sequence key field (like KEY=UNIQUE). A sequence key field definition cannot be deleted.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |