home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!ames!sun-barr!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: 16 Nov 1992 15:43:35 GMT
- Organization: Baylor College of Medicine, Houston, Tx
- Lines: 44
- Distribution: world
- Message-ID: <1e8fj7INN1sg@gazette.bcm.tmc.edu>
- References: <1992Nov14.174847.29576@lamont.ldgo.columbia.edu> <1992Nov15.144258.18635@panix.com> <1992Nov15.225853.2269@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
-
-
- In article <1992Nov15.225853.2269@lamont.ldgo.columbia.edu>, msolda@lamont.ldgo.columbia.edu (M Solda) writes:
- |>
- |> just to follow up, after posting my original article, i solved the problem by
- |> using a UNION operator to join the results into to identical queries, except
- |> of course, for the EXISTS clauses.
- |>
- |> i did try "transforming the OR into an AND", but as Dave points out, this would
- |> not work in all cases and this was such a case.
- |>
- |> anybody know if this is a reported bug?
- |>
- |> msolda
-
- Ummmmmmm, if you're still working on it, could you post the example
- code? I'm not quite following this.
-
- I know that in APT . . and in the Sybase server? . . . that the
- OR's and AND's logic is not implemented as with most *REAL* languages.
-
- In APT, testing does not stop with the first true statement in an
- OR clause(or first false statement in an AND clause); all statements
- are tested. EXAMPLE:
-
- if group_1:used > 1 and
- group_1[group_1:used - 2].field_1 is NULL
- begin
- . . . .
- end
-
- In the case where group_1 has only 1 row, the test should fail
- after the test for "group_1:used > 1" but it DOESN'T, it tries to
- do the second part of the test, which causes an error since there
- is no such index as -1 for a group (in APT). Most languages will
- allow this type of programming . . .APT requires that this be broken
- up into nested IF's . . .
-
- I said that to say this . . . .
-
- Maybe there's some sort of limitation on the nesting of
- EXISTS and NOT EXISTS within Sybase products . . even though it may
- sound plausible for it to work the way we want it . . . .
-
- Mark
-