472,779 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

A few questions on SET INTEGRITY

A few questions about SET INTEGRITY.

1) Docs: The SET INTEGRITY statement is under transaction control.

Using two sessions (different user, even) i tried the following.

Session 1: UPDATE COMMAND OPTIONS USING C OFF
Session 1: LOAD a TABLE
Session 2: SysCat.Tables.Status = 'C'
Session 1: SET INTEGRITY FOR table IMMEDIATE CHECKED
Session 2: SysCat.Tables.Status = ''

Shouldn't Session 1 require a COMMIT for SESSION 2 to see it?

2) DECLARE GLOBAL TEMPORARY TABLE A LIKE table.
SET INTEGRITY FOR table FOR EXCEPTION IN table USE SESSION.A

I had some exceptions, and this resulted in an error telling be i
didn't have INSERT permissions on SESSION.A.

I had to ask to DBA to create another (real) TABLE, and GRANT me
INSERT, and then the same statement worked.

Are GLOBAL TEMPORARY TABLEs not supported as EXCEPTION TABLEs?

3) SET INTEGRITY accepts more than one TABLE in its list of TABLEs.

(i) If all of the TABLEs are SysCat.Tables.Status = 'C' , the statement
work regardless of order.
(ii) If any of the TABLEs are SysCat.Tables.Status = '', the entire
statement fails.
(iii) If a TABLE is SysCat.Tables.Status = '' but will become
SysCat.Tables.Status = 'C' as a result of another TABLE in the
statement, the statement worksincluding this TABLE.

Why is (ii) like that? I can understand a warning message, but
complete failure of all TABLEs listed? And especially with (iii) it
doesn't seem correct.

B.

Dec 6 '06 #1
1 3730
One more. The docs state:

Turn on and perform integrity checking.

The privileges held by the authorization ID of the statement must
include at least one of the following:

* CONTROL privilege on the tables that are being checked and, if
exceptions are being posted to one or more exception tables, INSERT
privilege on those tables
* CONTROL privilege on all descendent foreign key tables,
descendent immediate materialized query tables, and descendent
immediate staging tables that will implicitly be placed in check
pending state by the statement
* LOAD authority and, if exceptions are being posted to one or more
tables:
o SELECT and DELETE privilege on each table being checked;
and
o INSERT privilege on the exception tables
* SYSADM or DBADM authority

Apparently, it requires LOCK on the TABLE as well. One user here has
LOAD in the DB, yet cannot SET INTEGRITY to IMMEDIATE CHECKED for a
TABLE :

SQL0551N "<user>" does not have the privilege to perform operation
"LOCK"
on object "<table>". SQLSTATE=42501

B.

Dec 6 '06 #2

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

Similar topics

0
by: Magic1812 | last post by:
Magic Software invites you to join us this coming Tuesday (January 27th, 2004) at 12:00 EDT / 17:00 GMT for a FREE live Webinar: Title: Data Integrity Using eDeveloper Date: January 27, 2004...
4
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
2
by: Brice | last post by:
Hello, Sorry if this is a basic question but I can't seem to find the answer in the DB2 tutorial series or my DB2 manuals. How does one check the data integrity and referential integrity of an...
2
by: Jim Worke | last post by:
Hi list, My boss would like to convert from MySQL to PostgreSQL, but there are a few things that hold us back. We'd like to have the databases in several physical servers, with referential...
12
by: technocrat | last post by:
I am trying to laod 2 tables and set integrtiy on them, but the second tables fails ( both are related and SET INTEGRITY ion first table succeeds) saying constraint violation....is there a way to...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
4
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for...
102
by: dreamznatcher | last post by:
Hello, I'm considering a career switch to a more database-related job, but need help on a few questions and issues. I'm a Computer Engineering graduate and have always felt most comfortable...
0
by: WTH | last post by:
I ask because I've got a windows service I've written that manages failover and replication for our products (or even 3rd party applications) and it worked great right until I tested it (for ease...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.