Types of pointers you can specify

In the HD access methods, segments in a database record are kept in hierarchical sequence using direct-address pointers.

Except for a few special cases, each prefix in an HD segment contains one or more pointers. Each pointer is 4 bytes long and consists of the relative byte address of the segment to which it points. Relative, in this case, means relative to the beginning of the data set.

Several different types of direct-address pointers exist, and you will see how each works in the topics that follow in this section. However, there are three basic types:

When segments in a database record are typically processed in hierarchical sequence, use hierarchical pointers. When segments in a database record are typically processed randomly, use a combination of physical child and physical twin pointers. One thing to keep in mind while reading about pointers is that the different types, subject to some rules, can be mixed within a database record. However, because pointers are specified by segment type, all occurrences of the same segment type have the same type of pointer.

Each type of pointer is examined separately in this topic. In the subtopics in this topic, each type of pointer is illustrated, and the database record on which each illustration is based is shown in the following figure.

Figure 1. Example database record for illustrating pointers
Two COURSE root segments. Below COURSE is INSTR, two LOC, and three STUDENT segments. Children of INSTR are EDUC and EXPR segments.