Solved

Operation not allowed for reason code "1"

Posted on 2006-06-21
2
5,446 Views
Last Modified: 2008-01-28
hELLO EXPERTS,

I am using IBM DB2 VERSION 8 devloper edition....

I needed to amend that data in a table, and so I used the load operation to load data from a tab delimited .txt file.

Unfortunately, now I can no longer open the table, I get error;-

com.ibm.db.DataException: A database manager error occurred. : [IBM][CLI Driver][DB2/NT] SQL0668N  Operation not allowed for reason code "1" on table "SCHEDULE".  SQLSTATE=57016


Is this fixable? All other tables open OK.



0
Comment
Question by:claracruz
2 Comments
 
LVL 5

Accepted Solution

by:
ocgstyles earned 500 total points
ID: 16952364
If from a command line you tye:

    db2 ? SQL0668N

The error you get states that your table is in check pending state.  This means that you loaded data into a table that has referential constraints defined on it.  

To see a listing of tables that are in check pending state as a result of the LOAD use this query:
 
  select tabname from syscat.tables where status = 'C'

To take the table out of check pending you use the SET INTEGRITY command.  You can view more on this command at:
       http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000998.htm

You can use this command to take the table out of check pending mode, but if this command fails due to RI violations, it will be placed back into check pending:

 SET INTEGRITY for <tablename> IMMEDIATE CHECKED

If this happens, you can look at the link above for more information about creating a table to place the violating rows into a separate table for later inspection to bring that table back online.

Good Luck

- Keith
0
 
LVL 13

Expert Comment

by:ghp7000
ID: 16955118
other options are available to you
if 'amend' means replace the data, simply load the file with the replace option instead of insert option
if amend means update data, then use import with the insert update option, although if your file is quite large, import will take a while
or
simply drop the constraint first, re load the data, and add the constraint, but of course the constraint will not be created if your data does not support it.

to load without doing any of the above:
to create exception tables:
db2 create table schemaname.xschedule as (select * from schedule) defintion only
db2 alter table schemaname.schedule add column timestamp add column description clob(32k)

use of load utility with exception table
db2 load..... for exception schemaname.xschedule
after load
db2 select * from xschedule






 
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question