Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: How to get rid of "warning" messages in db2cmd?

    Hi,
    using db2 v9.5 on Linux I have written recursive SQL, that is under control and never goes into infinitive loop. But SQL always returns warning message at the top of output:

    "SQL0347W The recursive common table expression "ADMIN.TEMP" may contain an
    infinite loop. SQLSTATE=01605".

    How to get rid of this warning message in db2cmd? Like turning off warnings?

    Thanks

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    I don't know wheather there is a way to turn off the warning.
    But, you can suppress SQL0347W warning message by including some code(or specific syntax) to your recursive SQL.

    http://www.dbforums.com/db2/1658407-...xpression.html

    Note: The description in the manual wrote an integer column.
    Not bigint, nor smallint.
    Last edited by tonkuma; 07-22-10 at 09:12. Reason: Add an note.

  3. #3
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Example 1(No warning):

    Code:
    ------------------------------ Commands Entered ------------------------------
    WITH r(k) AS (
    VALUES 1
    UNION ALL
    SELECT k + 1
      FROM r
     WHERE k < 3
    )
    SELECT * FROM r
    ;
    ------------------------------------------------------------------------------
    
    K          
    -----------
              1
              2
              3
    
      3 record(s) selected.

    Example 2(Warning SQL0347W):

    Code:
    ------------------------------ Commands Entered ------------------------------
    WITH r(k) AS (
    VALUES SMALLINT(1)
    UNION ALL
    SELECT k + 1
      FROM r
     WHERE k < 3
    )
    SELECT * FROM r
    ;
    ------------------------------------------------------------------------------
    
    K     
    ------
    SQL0347W  The recursive common table expression "DB2ADMIN.R" may contain an 
    infinite loop.  SQLSTATE=01605
    
         1
         2
         3
    
      3 record(s) selected with 1 warning messages printed.

    Example 3(Warning SQL0347W):

    Code:
    ------------------------------ Commands Entered ------------------------------
    WITH r(k) AS (
    VALUES BIGINT(1)
    UNION ALL
    SELECT k + 1
      FROM r
     WHERE k < 3
    )
    SELECT * FROM r
    ;
    ------------------------------------------------------------------------------
    
    K                   
    --------------------
    SQL0347W  The recursive common table expression "DB2ADMIN.R" may contain an 
    infinite loop.  SQLSTATE=01605
    
                       1
                       2
                       3
    
      3 record(s) selected with 1 warning messages printed.

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    tonkuma,
    example 1 solved my problem.
    Thanks a lot.

Posting Permissions

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