Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tikal!slovax!flak From: flak@slovax.UUCP (Dan Flak) Newsgroups: comp.databases Subject: Informix Brain Teaser Message-ID: <2678@slovax.UUCP> Date: 11 Jan 88 18:56:31 GMT Distribution: na Organization: R & D Associates., Tacoma, WA Lines: 36 Here's a brain teaser for you folks using Informix 3.30. (I can't validate SQL since I don't have it). The schema looks like: database foo file family field name type character 20 index primary field parent type character 20 index dups. end The data entry is set up (using PERFORM) so that once the first record is seeded into the database ("ADAM" or "EVE" if you prefer), all other records validate from the "name" field to accept legal values for the required "parent" field. Notice that the "index primary" in each field forces each individual name to be unique. The challenge: Write a progam using ACE and/or C which will accept as its first argument the name of any ancestor, and produce a list of all descendants for as many generations as are loaded in the database. I've run across this problem working with "Task Organizations" with the U.S. Army, but I could also see an application in genetics, railroad management (i.e. trains, and trains of trains), or any other problem where the whole is equal to the sum of its parts, but those parts aren't always permanently assigned. I really would like to see how others have solved this problem. -- {hplsla,uw-beaver}!tikal!slovax!flak Dan Flak-R & D Associates,3625 Perkins Lane SW,Tacoma,Wa 98499,206-581-1322