Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Operation not allowed for reason code "1"

Posted on 2006-06-21
2
Medium Priority
?
6,043 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 (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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

916 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