View previous topic :: View next topic
|
Author |
Message |
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
I have issued commit before deleting from table A |
why? Are you sure the rows are still alive for delete? |
|
Back to top |
|
|
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
|