Page 1 of 1

Delete row using Cursor having multiple rows

PostPosted: Sat Mar 15, 2014 7:22 pm
by nikesh_rai
Hi,

I have declared a Cursor as below:

DECLARE WS-A-SR CURSOR WITH HOLD FOR
       SELECT A.COLUMN_1, A.COLUMN_2, A.COLUMN_3,B.COLUMN_1,B.COLUMN_2
       FROM (SELECT COLUMN_1,COLUMN_2,COLUMN_3 FROM TABLEXX) AS A
       INNER JOIN (SELECT COLUMN_1, COLUMN_2 FROM TABLEZZ) AS B
        ON A.COLUMN_1 = B.COLUMN_1
          AND A.COLUMN_3 = B.COLUMN_3
       WHERE A.COLUMN_5 = Some Value
          AND A.COLUMN_6 = Some Value
       FOR UPDATE


Now, I have to use delete cursor to delete rows from table a XX, I used the below statement in the same program:

DELETE FROM TABLEXX
WHERE CURRENT OF WS-A-SR


However I am getting error code -510 at bind time. Please suggest me if something is wrong here

Re: Delete row using Cursor having multiple rows

PostPosted: Sat Mar 15, 2014 7:23 pm
by nikesh_rai
Sorry, the title should be

Delete row using Cursor having multiple tables