EMS logo  Produkt Navigation  Wählen Sie Ihr DB-Tool aus  Unsere
Partnerschaften  Microsoft Certified Partner Oracle Certified
Partner Embarcadero Technology Partner  SQL Artikel  Alle SQL
Artikel  Paragon Corporation Using PostgreSQL User-Defined
Functions to solve the Tree Problem  The Problem: Suppose you
are tracking supplies and have a field called si_item and
another called si_parentid. The parent keeps track of what
subclass a supply item belongs to. E.g. you have paper parent
that has subclasses such as recycled, non-recycled. When someone
takes supplies, you want to return the fully qualified name e.g.
Paper->Recycled->20 Lb  Below is what the structure of your
table looks like.  si_id int, si_parentid int, si_item. In your
table are the following entries si_id si_parentid si_item 1  
Paper 2 1 Recycled 3 2 20 lb 4 2 40 lb 5 1 Non-Recycled 6 5 20
lb 7 5 40 lb 8 5 Scraps  Now everyone at work is asked to throw
all their paper in the recycle bin for recycling. With
recycling, we are told we will save t