| |
|
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.
|
 |

03-15-10, 17:33
|
|
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!
|
|

03-15-10, 18:11
|
|
Registered User
|
|
Join Date: Feb 2008
Location: Japan
Posts: 2,177
|
|
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).
|
|

03-15-10, 22:30
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,195
|
|
|
|
Quote:
Originally Posted by brucejin
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
|
|

03-16-10, 09:38
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 24
|
|
|
|

07-21-11, 08:59
|
|
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...
|
|

07-21-11, 09:23
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,574
|
|
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
|
|

07-21-11, 11:07
|
|
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...
|
|

07-21-11, 11:12
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,574
|
|
|
|

07-22-11, 03:54
|
|
Registered User
|
|
Join Date: Jul 2011
Posts: 3
|
|
|
it worked
and that worked just perfect! I really appreciate your advise!
|
|

12-05-11, 10:42
|
|
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!!!!!
|
|

12-05-11, 11:19
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,574
|
|
Quote:
Originally Posted by zenit
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
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|