Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!swrinde!mips!pacbell.com!pacbell!rtech!ingres!ingres.com!billc From: billc@ingres.com (Bill Coffin, x3387) Newsgroups: comp.databases Subject: Re: Bizarre Database Reporting Message-ID: <1991May15.173012.1548@ingres.Ingres.COM> Date: 15 May 91 17:30:11 GMT References: <1991May13.162936.14729@hellgate.utah.edu> Lines: 26 From article <1991May13.162936.14729@hellgate.utah.edu>, by knechod%peruvian.utah.edu@cs.utah.edu (Kevin Nechodom): > Here is a question that I have used to harass the database companies > that bring in their "Wonderful World of Our Database" shows. This is just > a base case; any response to this question will quite likely inspire a flurry > of counter-questions. Anyway... Sounds like you're out for blood. Anyway, here's a quick knockoff on Ingres. It requires some "dictionary" support, but I'd be surprised to find an RDBMS that didn't have a table describing table columns. select i.id, c.column_name from iemps i, iicolumns c where c.table_name='iemps' and ( (c.column_name = 'name' and i.name is null) or (c.column_name = 'dept' and i.dept is null) or (c.column_name = 'salary' and i.salary is null) ) You could easily write a little tool that would generate this query automatically, just by feeding it a table name. -- Bill Coffin, aka billc@ingres.com FETCH INTO :standard_disclaimer, :gratuitous_witticism, :obscure_quote