473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Cursor load giving SQL0668 error



UDB Version 8.2 FP7 (r"DB2 v8.1.1.128", "s061108", "U810098", and
FixPak
"14".) 64 bit running on AIX 5.3.

We were getting the SQL0668 error below so we put the status sql into
the script to see the table state right before the cursor/load ran.
The table did not seem to be in a bad state. We switched this cursor/
load back to a regular export/load and the issue went away. We are
doing several cursor loads on some 52Million row tables after this
with no issues.

Does anyone have a clue as to why this was occurring?
select tabname,status,access_mode from syscat.tables where status !=
'N'

TABNAME
STATUS ACCESS_MODE
-----------------------------------------------------------------------------------------------------------------------------
--- ------ -----------
BNKACCTPRGVW
X F
BNKCUSTRECPRGVW
X F

2 record(s) selected.
values current timestamp

1
--------------------------
2007-10-16-19.29.51.268018

1 record(s) selected.
declare corprodinst cursor for select ((select
coalesce(max(CORProdInstanceKy), 0) from CORProdInstance) +
t.CORProdInstanceK
y), CORProductKy, productCode, updateDttm, updateUser, updateSystem,
versionStamp, COROrgKyFI from tmp_CORProdInstance t
DB20000I The SQL command completed successfully.

values current timestamp

1
--------------------------
2007-10-16-19.29.51.271669

1 record(s) selected.
load from corprodinst of cursor INSERT INTO CORProdInstance
(CORProdInstanceKy, CORProductKy, productHeldId, updateDttm, upda
teUser, updateSystem, versionStamp, COROrgKyFI)
SQL3501W The table space(s) in which the table resides will not be
placed in
backup pending state since forward recovery is disabled for the
database.

SQL0668N Operation not allowed for reason code "1" on table
"SDB3036.CORPRODINSTANCE". SQLSTATE=57016

Oct 17 '07 #1
1 5307
Ultrak The DBA wrote:
>

UDB Version 8.2 FP7 (r"DB2 v8.1.1.128", "s061108", "U810098", and
FixPak
"14".) 64 bit running on AIX 5.3.

We were getting the SQL0668 error below so we put the status sql into
the script to see the table state right before the cursor/load ran.
The table did not seem to be in a bad state. We switched this cursor/
load back to a regular export/load and the issue went away. We are
doing several cursor loads on some 52Million row tables after this
with no issues.

Does anyone have a clue as to why this was occurring?
select tabname,status,access_mode from syscat.tables where status !=
'N'

TABNAME
STATUS ACCESS_MODE
-----------------------------------------------------------------------------------------------------------------------------
--- ------ -----------
BNKACCTPRGVW
X F
BNKCUSTRECPRGVW
X F

2 record(s) selected.
values current timestamp

1
--------------------------
2007-10-16-19.29.51.268018

1 record(s) selected.
declare corprodinst cursor for select ((select
coalesce(max(CORProdInstanceKy), 0) from CORProdInstance) +
t.CORProdInstanceK
y), CORProductKy, productCode, updateDttm, updateUser, updateSystem,
versionStamp, COROrgKyFI from tmp_CORProdInstance t
DB20000I The SQL command completed successfully.

values current timestamp

1
--------------------------
2007-10-16-19.29.51.271669

1 record(s) selected.
load from corprodinst of cursor INSERT INTO CORProdInstance
(CORProdInstanceKy, CORProductKy, productHeldId, updateDttm, upda
teUser, updateSystem, versionStamp, COROrgKyFI)
SQL3501W The table space(s) in which the table resides will not be
placed in
backup pending state since forward recovery is disabled for the
database.

SQL0668N Operation not allowed for reason code "1" on table
"SDB3036.CORPRODINSTANCE". SQLSTATE=57016

I guess you run the LOAD twice without the necessary SET INTEGRITY statement
in between. The explanation for SQL0668 tells you what's wrong and how to
fix this:

$ db2 "? sql668"
SQL0668N Operation not allowed for reason code
"<reason-code>" on table "<table-name>".

Explanation:

Access to table "<table-name>" is restricted. The cause is based
on the following reason codes "<reason-code>":
1 The table is in the Set Integrity Pending No Access state.
The integrity of the table is not enforced and the content of the
table may be invalid. An operation on a parent table or an
underlying table that is not in the Set Integrity Pending No
Access state may also receive this error if a dependent table is
in the Set Integrity Pending No Access state.

[...]
User Response:
1 Execute the SET INTEGRITY statement with the IMMEDIATE CHECKED
option on table "<table-name>" to bring the table out of the
Set Integrity Pending No Access state. For a user
maintained materialized query table, execute the statement
with the IMMEDIATE UNCHECKED option instead of the
IMMEDIATE CHECKED option.

[...]

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Oct 17 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bissatch | last post by:
Hi, I have just recently installed Apache2 and PHP5 on my computer. Normally when I make a syntax mistake on my webspace it gives me an error message on the .php page when i load it and the line...
7
by: jane | last post by:
I'm going to use cursor load to load 200GB data in my production database. My database has 2 partitions. but I cannot find more info in the manual about this cursor load. I'm concern about...
12
by: prasi | last post by:
hi all, I have executed the following program, I was expecting some errors in the program but it didn't give any ERRORS!!!!!!!!!!!!!!!!!!!!!!!!!!! please can anybody explain me ?...
1
by: Kevin | last post by:
Hi, I have a web app running on my own machine, I copied all the files in the folder and transferred them all to our web server. When I try to run the app on the web server, I get an 'Could not...
5
by: washoetech | last post by:
Hello, I have tried to run my ASP.NET 2.0 application from IIS and I get a page not found error. When I debug from within Visual Studio.NET 2005 my application works fine. Any ideas? ...
3
by: db2udbgirl | last post by:
Env: DB2 UDB 8.2, AIX 5.3 While trying to load data (73 Million rows, Medium size table uses 4K tablespace) into a table using cursor it fails with "SQL0964C The transaction log for the database...
1
by: bujjus173 | last post by:
Hi, I like to load data from one table in a database in a server into another table in another database residing in another server. I like to use cursor load. in that case. 1) Do i need to...
1
by: b singh | last post by:
In iis 7 http:/site/x.aspx/pp%3f is giving runtime error Instaed of invalid virtual path. x.aspx is not existing in the server. What setting of IIS 7 is reuired so that it will give invalid...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.