Solved

Operation not allowed for reason code "1"

Posted on 2006-06-21
2
5,260 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now