Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ames!ucsd!usc!cs.utexas.edu!uunet!tellab5!segel From: segel@Tellabs.COM (Mike Segel) Newsgroups: comp.databases Subject: Re: SQL Poser Message-ID: <2726@tellab5.tellabs.com> Date: 3 Jun 90 19:46:01 GMT References: <6588@umd5.umd.edu> Organization: Tellabs, Inc. Lisle IL Lines: 44 If I can use a 4gl like Informix, the solution would be : input employee name; select manager from table where employee_name = emp; /* from Jon's cut */ Print "The chain of command for employee ", employee_name, "is \n"; While ( employee_name != manager) { print manager , " - "; employee_name = manager; select manager from table where employee_name = emp; } print manager , "\n"; ----------------------------------- Now the above program is in a pseudo code. Notice that there is no recursion, just a while loop. If you really wanted to get dirty, you could implement this in an Assembler language. Now Oracle has an extension to SQL ? Their solution is cute. depending on how they did it, I can think of some drawbacks to it. Does it keep the querried items in a temp table? Or on a stack? So now you have your sample querry done, how do you get the data out. If it is stored in a temp table, then the same solution can be done in any 4gl. Does it really matter if the extension occurs to the SQL, or if you are using a 4gl ? I really question Oracle's solution. Where is the information stored? If on a stack, then depending on the depth of the querry, and the size of the information stored, then you could run into trouble. This type of example is good reason for 4GLs. They allow for high language type of control, merged in with std sql. My point is, you need to use the right tool for the job. Am I making sense or have I been working too long? -Mike