home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / sybase / 325 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  2.3 KB

  1. Path: sparky!uunet!think.com!ames!sun-barr!cs.utexas.edu!bcm!mparsons
  2. From: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
  3. Newsgroups: comp.databases.sybase
  4. Subject: Re: multiple EXISTS subqueries under Sybase 4.8
  5. Date: 16 Nov 1992 15:43:35 GMT
  6. Organization: Baylor College of Medicine, Houston, Tx
  7. Lines: 44
  8. Distribution: world
  9. Message-ID: <1e8fj7INN1sg@gazette.bcm.tmc.edu>
  10. References: <1992Nov14.174847.29576@lamont.ldgo.columbia.edu> <1992Nov15.144258.18635@panix.com> <1992Nov15.225853.2269@lamont.ldgo.columbia.edu>
  11. Reply-To: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
  12. NNTP-Posting-Host: fleming.csc.bcm.tmc.edu
  13. Keywords: EXISTS, 4.8, sun4, sunos 4.1.1
  14. Originator: mparsons@fleming.csc.bcm.tmc.edu
  15.  
  16.  
  17. In article <1992Nov15.225853.2269@lamont.ldgo.columbia.edu>, msolda@lamont.ldgo.columbia.edu (M Solda) writes:
  18. |> 
  19. |> just to follow up, after posting my original article, i solved the problem by
  20. |> using a UNION operator to join the results into to identical queries, except 
  21. |> of course, for the EXISTS clauses.
  22. |> 
  23. |> i did try "transforming the OR into an AND", but as Dave points out, this would
  24. |> not work in all cases and this was such a case.
  25. |> 
  26. |> anybody know if this is a reported bug?
  27. |> 
  28. |> msolda
  29.  
  30. Ummmmmmm, if you're still working on it, could you post the example
  31. code?  I'm not quite following this.
  32.  
  33. I know that in APT . . and in the Sybase server? . . . that the
  34. OR's and AND's logic is not implemented as with most *REAL* languages.
  35.  
  36. In APT, testing does not stop with the first true statement in an
  37. OR clause(or first false statement in an AND clause); all statements
  38. are tested.  EXAMPLE:
  39.  
  40.     if group_1:used > 1 and
  41.        group_1[group_1:used - 2].field_1 is NULL
  42.     begin
  43.         . . . . 
  44.     end 
  45.  
  46. In the case where group_1 has only 1 row, the test should fail
  47. after the test for "group_1:used > 1" but it DOESN'T, it tries to
  48. do the second part of the test, which causes an error since there
  49. is no such index as -1 for a group (in APT).  Most languages will
  50. allow this type of programming . . .APT requires that this be broken
  51. up into nested IF's . . . 
  52.  
  53. I said that to say this . . . . 
  54.  
  55.     Maybe there's some sort of limitation on the nesting of
  56. EXISTS and NOT EXISTS within Sybase products . . even though it may
  57. sound plausible for it to work the way we want it . . . . 
  58.  
  59. Mark 
  60.