Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    64

    Unanswered: EXPLAIN PLAN for access path on CTE Recursive queries

    Hi,

    Db2 V9 on z/OS.

    I wonder if EXPLAIN has a different syntax on recursive queries using common table expression.

    When I use this,

    EXPLAIN PLAN SET QUERYNO = 20 FOR (
    WITH NUMBERS (.....)
    SELECT ... FROM NUMBERS ) ;

    I get,

    SQLCODE -199. Illegal use of keyword WITH. Token SELECT ( was expected.


    Thanks in advance for any tips!
    amar

  2. #2
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Just remove the parentheses:
    Code:
    EXPLAIN PLAN SET QUERYNO = 20 FOR
      WITH NUMBERS AS (SELECT .....)
      SELECT ... FROM NUMBERS ;
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  3. #3
    Join Date
    Apr 2004
    Posts
    64
    Thanks Peter!

Posting Permissions

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