Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    24

    Unanswered: Query syntax problem

    Hi,
    I'm getting the error message that there is a syntax error in the FROM clause. The two nested queries work so I think it has got something to do with the 'WHERE EXISTS' clause. When the error is generated the cursor highlights the WHERE. It could be because there is another WHERE after it but I don't know.
    This is driving me crazy!

    SELECT cd.CR_DEFECT_REF_NUM
    FROM CR_DEFECT cd
    WHERE EXISTS (SELECT NULL FROM CHANGED_ETL_OBJECTS ceo,
    WHERE ceo.CR_DEFECT_REF_NUM = cd.CR_DEFECT_REF_NUM
    AND ceo.REPOSITORY = cp.FROM_REPOSITORY)
    OR
    cd.CR_DEFECT_REF_NUM IN
    (SELECT pi.CR_DEFECT_REF_NUM FROM PROMOTION_ITEMS pi, CODE_PROMOTION cp WHERE pi.PROMOTION_ID = cp.PROMOTION_ID AND CP.TO_REPOSITORY = ceo.REPOSITORY

    AND cd.CR_DEFECT_REF_NUM NOT IN
    (SELECT pi.CR_DEFECT_REF_NUM FROM PROMOTION_ITEMS pi, CODE_PROMOTION cp
    WHERE pi.PROMOTION_ID = cp.PROMOTION_ID
    AND CP.TO_REPOSITORY =ceo.REPOSITORY))

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    FROM CR_DEFECT cd

    should be

    FROM CR_DEFECT AS cd

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    And it looks like you're missing a few other "AS"'s as well ....

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i bet it's the comma after the alias ceo in front of the WHERE keyword

    rudy
    http://r937.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •