Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!ucsd!dog.ee.lbl.gov!ucbvax!hplabs!pyramid!unify!nico From: nico@Unify.Com (Nico Nierenberg) Newsgroups: comp.databases Subject: Re: Reports from SQL databases Keywords: SQL reports Message-ID: Date: 29 Mar 91 18:23:23 GMT References: <5197@mrmarx.UUCP> Organization: Unify Corporation, Sacramento, CA, USA Lines: 78 In article <5197@mrmarx.UUCP> cant@mrmarx.msc.com (Jim Cant) writes: >I have several questions and would appreciate any help I can get from >people on the net. > >What is a good general reference for SQL that would cover generating >polished reports from databases in particular. I suspect a text book >rather than user documentation for a specific database is what I >need. I need to solve problems such as the following. > >Here is a general question. I need to print reports with fields such >as sex and would like the printed output to say "male" or "female". The >database contains 1 and 0 for these values. How can I test each >record returned by a select statement for the value of sex and write >out "male" or "female" as appropriate. One solution that occurs is to >create a second temporary table, put in the records of generated by the >querry with a additional text field, then update the text field with >"male" or "female" depending on the value of the sex field. The use >this temporary table as the source of the data for the report. A very simple solution is to create a "sex" table that contains two rows. cd | text --------------------- 0 | female 1 | male Then simply join this table to whatever other table(s) are being selected based on the "cd" field. For example select name, sex.text from person,sex where person.sexcode = sex.cd; The temporary table idea would work but it is a lot of extra effort, and resource use. > >Is this the right approach? Is it a good one? Will it work at all? >(I am using Sybase on the IBM RS6000 running AIX v3.1) > >Are there any good third party products for report generation from >SQL databases. An outstanding product for this is our Accell/SQL package which includes a procedural report writer. Simply factual information folks. It runs very nicely with Sybase which is an outstanding DBMS. > >Are there any other database oriented newsgroups? Any for SQL or for >particular products? > > >Thanks in advance > > >Jim Cant > >p.s. This is my first posting from a new Email address; would somebody >please respond just to test the mail system. thanks > > >Jim Cant cant@mrmarx.msc.com >Mainstream Software Corp. or >411 Waverly Oaks Road uunet!mrmarx.msc.com!cant >Waltham, MA 02154 (617) 894-3399 -- --------------------------------------------------------------------- Nicolas Nierenberg "No matter where you go, Unify Corp. there you are." nico@unify