You are here

Table links

To sort out table links, you will really need your pen and paper to hand, because Web-D-Zine(WDZ) is only set up to deal with two types of links.

The parent child link

An example of a parent child link is categories where you have one table defining the header information, then a child table that stores all the details. These two tables are linked via a parent child link. The field name for these type of links always have the same format. Parent - "Parent table code"."Field name", Child - "Child table code"."Parent table code"."Field name"

Xref links

These can be broken down into two types:-

  • A link between two different parents. An example of this could be product comments, a user(Parent)can leave comments about different products(Parent). The comment table is the link between the two and is the child of both parents. The field name for these xref links follows the same format as the parent child links. If you want one parent to be the master, for example only the user can edit and add comments, then add this parent child first.
  • A link between two different records in the same parent table. You need this type of link when you want to link two different products together. For example when you want to link an engagement ring to its matching wedding band. It is the link table that is used as the bridge between the two products. The first field name for the child matches the child format from parent child links, while the second matches "Child table code".xref."Parent table code"."Field name"

No more than two parent fields are allowed in any child table.

Regardless of the type of link that you want to produce, they all start at the same place and that is with the parents:-

  • xxxId - This is an id that can be used externally and can be used as a link to a child table. The Ids for these are generated and are not affected by an auto id, so can be successfully transferred from one data base to another. The reason that you will use an id is for a shortcut way of looking at a product or some other item that uses external links. From a safty point of view, you should never use this type of parent for say a customer record. Otherwise people will go, I wonder if I change that id, I might get to see somebody else's personal details
  • code - This is a written code, that needs to be unique in the parent table. Categories uses the code as a parent key so that you can easily access the information contained in the category without looking it up.
  • key - This is the preferred method for any records that contains sensitive information like user records. There are two keys below and they only differ in the length of the key. You tube that has one or two customer records, uses the 24 character length key, and uses the 11 character length key to access the videos.

Only one parent code is allowed in a table.

Report

Key
UhtckaF9x9l
Value
xxxId
Title
External Id
Group
Sequence and ids
Bundle
Parent
Sequence
20
Type
Parent - Id
Name
xxx Id
Field name
xxxId
Data base type
INT
Size
0
Default
0
Comment
External Id
Display
Description
External Id by which a record can be retrieved but not edited
Form Type
text
Category
-1
Validation
INT
Index type
Index
Searchable
Yes
Retrieve
Yes
Sort
NO
Encrypt
NO