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 > Sqlcode: -668, sqlstate: 57016, sqlerrmc: 7

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-15-10, 18:33
brucejin brucejin is offline
Registered User
 
Join Date: Feb 2010
Posts: 24
Sqlcode: -668, sqlstate: 57016, sqlerrmc: 7

I did a 'ALTER TABLE ALTER COLUMN on table XXX. I changed one column from CHAR(30) to VARCHAR(2000) and added one CHAR(1) column.
It was successful. But after the ALTER I got this error when access table XXX in a Java JDBC

DB2 SQL error: SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 7

Have tried everything found googling but could not get rid of the error.

The SQL used in Java is
SELECT T01."SEQNO", T01."VALUE3", "DELIMIT" FROM "SCHEMA.XXX" T01 WHERE T01."SEQNO"=1 FOR UPDATE OF "VALUE3", "DELIMIT"


Any ideas?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 03-15-10, 19:11
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 1,830
User response for reason-code:7

Reorganize the table using the REORG TABLE
command (note that INPLACE REORG TABLE
is not allowed for a table that is in the reorg
pending state).
Reply With Quote
  #3 (permalink)  
Old 03-15-10, 23:30
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,007
Quote:
Originally Posted by brucejin View Post
Have tried everything found googling but could not get rid of the error.?
Next time, try reading the official DB2 documentation. You can use the online InfoCenter (this link is for version 9.7) or download the PDF manual for DB2 Messages Vol 2.
SQL0668N
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 03-16-10, 10:38
brucejin brucejin is offline
Registered User
 
Join Date: Feb 2010
Posts: 24
Thanks!
REORG works (IBM - Summarization and Pruning Agent failure attempting to insert a null value into the ITCAM for SOA summarization tables.).
DB2/NT is a little special. I did the same ALTER on DB2/AS400, Oracle, MS SQL server, MySQL prior to DB2/NT and they all went OK without special treatment.
Reply With Quote
  #5 (permalink)  
Old 07-21-11, 09:59
dani_vlc dani_vlc is offline
Registered User
 
Join Date: Jul 2011
Posts: 3
but how about if can run reorg command?

I have the same problem after I've dropped a column (if I'd had known this)and I can't run the reorg command, I get this error message:
DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=TABLE;REORG ;JOIN <joined_table>, DRIVER=3.53.70

if I run a select on table I get other message:
DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7;DB2UT015.EXP_RECORD

Is it already running the reorg command? any ideas how can I verify it?


thanks^1000...
Reply With Quote
  #6 (permalink)  
Old 07-21-11, 10:23
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,473
SQLCODE -104 is a syntax error. What is the reorg command you are trying to do, and how are you trying to do it?

Andy
Reply With Quote
  #7 (permalink)  
Old 07-21-11, 12:07
dani_vlc dani_vlc is offline
Registered User
 
Join Date: Jul 2011
Posts: 3
I've tried many forms, like
reorg table EXP_RECORD;
reorg table db2u7015.EXP_RECORD;

and I am using DbVisualizer, can be that the problem? looks like the editor doesn't recognize command reorg, because it doesn't highlight the word as it does with works like table or select...
Reply With Quote
  #8 (permalink)  
Old 07-21-11, 12:12
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,473
That is what I suspected. REORG is not SQL, it is a DB2 command and cannot be executed as if it was SQL. You can either use the CLP to use REORG or you can use: IBM DB2 9.5 Information Center for Linux, UNIX, and Windows if you must use SQL.

Andy
Reply With Quote
  #9 (permalink)  
Old 07-22-11, 04:54
dani_vlc dani_vlc is offline
Registered User
 
Join Date: Jul 2011
Posts: 3
it worked

and that worked just perfect! I really appreciate your advise!
Reply With Quote
  #10 (permalink)  
Old 12-05-11, 11:42
zenit zenit is offline
Registered User
 
Join Date: Dec 2011
Posts: 1
What can be helpful as well?

I have a big amount of SQLs which have to be executed in a sequence. Your solution helped me in some cases, after the tables have been altered. BUT!!!! thera re a lot of situaitions, where the REORG statement doesn't help. I am trying to make the insert into tha table, get the 668 ErrorCode and the reorg doesn't make it work! Do you have guys any ideas why and how to solve it!

How can I check in which "pending" state the table currently is. Do I probably make some kind of additionial commit or wait before the next statement....

Thanks a lot in advance for your help!!!!!
Reply With Quote
  #11 (permalink)  
Old 12-05-11, 12:19
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,473
Quote:
Originally Posted by zenit View Post
I have a big amount of SQLs which have to be executed in a sequence. Your solution helped me in some cases, after the tables have been altered. BUT!!!! thera re a lot of situaitions, where the REORG statement doesn't help. I am trying to make the insert into tha table, get the 668 ErrorCode and the reorg doesn't make it work! Do you have guys any ideas why and how to solve it!

How can I check in which "pending" state the table currently is. Do I probably make some kind of additionial commit or wait before the next statement....

Thanks a lot in advance for your help!!!!!
You can get 668 for several reasons. You need to post the entire error you are getting.

Andy
Reply With Quote
Reply

Thread Tools
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