home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / sybase / 586 < prev    next >
Encoding:
Text File  |  1993-01-04  |  1.8 KB  |  62 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!wupost!gumby!destroyer!cs.ubc.ca!newsserver.sfu.ca!sfu.ca!wolfgang
  3. From: wolfgang@fraser.sfu.ca (Wolfgang Richter)
  4. Subject: Re: Using Views for data presentation
  5. Message-ID: <wolfgang.726176551@sfu.ca>
  6. Sender: news@sfu.ca
  7. Organization: Simon Fraser University, Burnaby, B.C., Canada
  8. References: <92356.101548IDAZS@ASUACAD.BITNET>
  9. Date: Mon, 4 Jan 1993 19:42:31 GMT
  10. Lines: 50
  11.  
  12. <IDAZS@ASUACAD.BITNET> writes:
  13.  
  14.  
  15. >Dear Netters,
  16.  
  17. >        We here at ASU are trying to create Views for mailing labels.
  18.  
  19. >First and last names are stored in separate fields in upper
  20.  
  21. >case. We have been partially successful in combining them to display
  22.  
  23. >in upper-lower case, using "substring" and "rtrim" functions. Names
  24.  
  25. >that have spaces or dashes, like "James Mc donald" or
  26.  
  27. >"Carol Terry-peplow" have been a problem. It seems that we cannot use
  28.  
  29. >conditionals ('if', 'else') within a view.
  30.  
  31. >       If anyone has solved this problem or has a recommendation
  32.  
  33. >please let us know. We are running SQL Server 4.8, and accessing the
  34.  
  35. >data with views through client tools such as DataPrism.
  36.  
  37. >       Thanks.
  38.  
  39. >       Ajay Surana
  40. >       John Rome
  41. >       Data Administration
  42. >       Arizona State University
  43. >       Tempe, AZ
  44. >       (602) 965-0857
  45.  
  46. I have run into this kind of limitation myself. What is needed is an
  47. extension to Sybase's SQL that allows one to use an IF function (such
  48. a function exists in other non-SQL DBMS's such as dBase and FileMaker
  49. Pro). Syntax for such a function could be:
  50.  
  51.     IIF(<condition>,<expression_if_true>,<expression_if_false>)
  52.  
  53. Since "IF" is a reserved word already, I used "IIF" to denote
  54. "Immediate If".
  55. -- 
  56. -- Wolfgang Richter (e-mail: wolfgang@sfu.ca)
  57. -- Academic Computing Services
  58. -- Simon Fraser University
  59. -- Burnaby, B.C.
  60. -- Canada V5A 1S6
  61. -- Phone: 604-291-4449
  62.