How Far Does the Failed Supply Line Reach?

Follow a hierarchy or dependency graph using an anchor, a repeated join and explicit safeguards against cycles and excessive traversal.

13 sections · 4 questions · 1 coding challenge

1 / 13

Repeated Relationships Needed More Than a Fixed Join

BOTIE

A parts list, reporting hierarchy or network can contain an unknown number of levels. Recursive CTEs let a query start from a known row and repeatedly follow a relationship. The database documents describe that repeated expansion explicitly, including examples where a cycle would otherwise keep producing work.

The maintenance question is the same one: which records can we reach from this starting point? Our path guard rejects a return to a node already on the current path. A separate depth limit bounds how far this particular report is allowed to explore.

Sources for this history