If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to get rid of "warning" messages in db2cmd?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-10, 03:38
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #2 (permalink)  
Old 07-22-10, 08:07
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,195
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.

Sqlcode = 347, warning: The recursive common table expression

Note: The description in the manual wrote an integer column.
Not bigint, nor smallint.

Last edited by tonkuma; 07-22-10 at 08:12. Reason: Add an note.
Reply With Quote
  #3 (permalink)  
Old 07-22-10, 08:21
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,195
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.
Reply With Quote
  #4 (permalink)  
Old 07-23-10, 01:39
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
tonkuma,
example 1 solved my problem.
Thanks a lot.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On