IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to resolve -532


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Aug 06, 2015 10:03 pm
Reply with quote

Hi all

In my program I am using multi row cursor for three tables table A table B and table C. Table A is parent of table B and table B is parent of table C. In my program I have used 3 multi row with for update cursors. Cursor 1 is declared as below
Code:

Declare cursor cursor1 with hold
 With rowset positioning
Select c1
From tableA
where crdate  < current date - 10 days
For update

Declare cursor  cursor2 with hold
With rowset positioning
Select 1
From tableB
Where c1 = :TableA.C1
For update

Declare cursor  cursor3 with hold
With rowset positioning
Select 1
From tableC
Where c1 = :TableA.C1
For update



After fetching rows from table A, I am deleting rows from
Table C followed with table B, while I am deleting the row using where current of in table A I am getting -532. I have issued commit before deleting from table A till it gives the same sql code. If rows of child table is deleted then why I am getting this sql code? Please let me know how to resolve it.
I have replaced delete of table A where current of with normal delete using where clause for sql code =100 and sqlerrd(3) > 0 (during fetch of cursor1 )
It worked. But I need to know why current of failed?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Aug 07, 2015 12:25 am
Reply with quote

Quote:
I have issued commit before deleting from table A

why? Are you sure the rows are still alive for delete?
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Aug 07, 2015 7:09 am
Reply with quote

Without commit also I got the same error. I tried to commit to ensure the descendants table rows are deleted so that it won't throw sql code -532
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Aug 07, 2015 5:51 pm
Reply with quote

The -532 is described as
Quote:
-532
THE RELATIONSHIP constraint-name RESTRICTS THE DELETION OF ROW WITH RID X rid-number


So you need to see what the relationship constraint is.

Garry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Need help to resolve a hard edit COBOL Programming 8
This topic is locked: you cannot edit posts or make replies. Need help to resolve a hard edit COBOL Programming 4
No new posts How to resolve SYNCH15! & SYNCH16... Compuware & Other Tools 0
No new posts How to resolve sqlcode of CALL ATTACH... DB2 3
No new posts How to resolve U4038? COBOL Programming 5
Search our Forums:

Back to Top