Inter-DB Connection Macros
- Last UpdatedNov 14, 2025
- 3 minute read
Access to a DB is usually controlled in such a way that only one user can modify the content of that Database (DB) at any one time; that is, only one user can have Write access to the DB. Other users may have simultaneous Read access, depending how access rights have been set up in the Admin module.
In a multi-disciplinary project, in which different teams of users work on different aspects of the design, an individual user will usually have Read/Write access to the DBs controlled by their own team and Read-only access to DBs controlled by other teams. This works well until a user needs to connect an item in their team’s DB to an item in another team’s DB; for example, a member of the Piping team may wish to connect a Branch in a Piping DB to a Nozzle in an Equipment DB (to which they have Read-only access). In such a case, the design changes needed in the Equipment DB are stored in a ‘buffer’ file known as an inter-DB connection macro. Only when this macro is run by a member of the Equipment team, with Write access to the Equipment DB, are the changes implemented.
The sequence of events which would occur is illustrated in the following example.
Assume that Project ABC has separate Piping and Equipment design teams. Assume that User P has Read/Write access to a Piping DB and Read-only access to an Equipment DB, while User E has Read/Write access to the Equipment DB and Read-only access to the Piping DB.
User P wishes to connect a Branch Tail in their Piping DB to a Nozzle in User E’s Equipment DB; that is, they wish to set the Branch’s TREF in their Piping DB to point to the CREF of the Nozzle (which they can do) and to set the CREF of the Nozzle to point to the Tail Reference (TREF) of their Branch (which they can not do), thus:

-
User P sets the TREF of their Branch to point to the CREF of the Nozzle in the Equipment DB.
-
When User P tries to set the Nozzle’s CREF, they receive a message telling them that they are trying to connect to a read-only DB and that an inter-DB connection macro is being created automatically. This macro, which stores the commands needed to set the CREF, is given a name with the format abc001.mac (where the macro number, 001 here, is allocated sequentially), and is held in the directory ABCMAC (or as defined by the project’s environmental variables).
-
When User E next enters MONITOR, they receive a message asking them to run the inter-DB connection macro abc001.mac and to delete it when they have done so.
-
User E enters MODEL and runs the inter-DB connection macro by giving the command
$M /%ABCMAC%/abc001.mac
This sets the CREF for the Nozzle to point to the TREF of the Branch and completes the link between the two DBs.
-
User E enters MONITOR (or ADMIN if they have sufficient access rights) and deletes the redundant macro by giving the command
DELETE MACRO 1
where 1 is the macro number. This command is valid in Model, Monitor and Admin.
Notes: If User P checks their DB for data consistency errors between Stages 2 and 4, when the macro has been created but not yet run, they will get an ‘incompatible connection reference’ message. They cannot finalize their design until User E has run the macro. Thus, the successful use of inter-DB connection macros relies on good co-operation between the teams involved.
Inter-DB connection macros are also created in multi-write DBs if an attachment is claimed by another user.