home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!bcm!mparsons
- From: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
- Newsgroups: comp.databases.sybase
- Subject: Re: multiple EXISTS subqueries under Sybase 4.8
- Date: 19 Nov 1992 20:41:17 GMT
- Organization: Baylor College of Medicine, Houston, Tx
- Lines: 54
- Distribution: world
- Message-ID: <1egu5dINNmie@gazette.bcm.tmc.edu>
- References: <1992Nov14.174847.29576@lamont.ldgo.columbia.edu> <1992Nov15.144258.18635@panix.com> <1992Nov15.225853.2269@lamont.ldgo.columbia.edu> <1e8fj7INN1sg@gazette.bcm.tmc.edu> <1992Nov16.184540.11698@lamont.ldgo.columbia.edu> <1ee852INN90m@gazette.bcm.tmc.edu> <1992Nov19.174435.25700@lamont.ldgo.columbia.edu>
- Reply-To: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
- NNTP-Posting-Host: fleming.csc.bcm.tmc.edu
- Keywords: EXISTS, 4.8, sun4, sunos 4.1.1
- Originator: mparsons@fleming.csc.bcm.tmc.edu
-
-
-
- msolda,
-
- OK, let me ask you this . . . concerning the combined EXIST and
- NOT EXIST . . .
-
- If the EXIST test does not work, i.e., it's false, does the
- NOT EXIST test come out true?
-
- In other words, does the NOT EXIST part work, or at least
- get tested, if the EXIST part fails?
-
- If so, the problem could be that the server is not evaluating
- the NOT EXIST portion of the test since the EXIST portion solves your
- overall 'OR' test, i.e., if the EXIST is true, there's no need to
- do the NOT EXIST test.
-
- Of course, if that's the case, then Sybase is definitely
- a 'little' screwed up because . . . . APT will evaluate both arguments
- to the OR regardless of whether or not the first test is true. It'd
- be interesting to find out the the server and APT handle their OR's
- and AND's differently :-(
-
- Hmmmmmmmm, let me confuse this a little bit more?? ;-)
-
- In most languages the clauses that are 'connected' via an OR
- are evaluated one at a time. As soon as one of the tests evaluates as
- TRUE the testing is stopped since you only need one of them to be TRUE
- for the OR to be TRUE. Similar logic says that testing on clauses
- 'connected' by an AND will halt as soon as one of the tests comes up
- FALSE; reason being that all clauses must be TRUE for the AND to be
- TRUE soooooo, if any one of them comes up FALSE the entire AND is
- FALSE and no more testing is needed.
-
- In APT, this is not the case, *all* clauses 'connected' by an
- OR or AND, and I mean *ALL* clauses will be evaluated. All ten clauses
- in a large OR statement will be tested even if the first one evaluates
- to TRUE. And according to tech support, this is the way APT is suppose
- to work.
-
- Now, if the server works as I've mentioned above, i.e., testing
- stops as soon as one clause evaluates as TRUE(for an OR) or FALSE(for
- an AND), then it would appear that Sybase is inconsistent in their
- method of evaluating ANDs and ORs??
-
- Does that shed any light on the problem? Or am I beating a dead horse? ;-)
-
- Comments from others that have 'played' with this?
-
- Mark
-
-
-
-