Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to use Update cursor when deleting the row

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
emonmisra

New User


Joined: 10 Jul 2006
Posts: 7
Location: Bangalore

PostPosted: Thu Jan 03, 2008 11:01 am    Post subject: How to use Update cursor when deleting the row
Reply with quote

The queries are as follows:

Declaring the cursor
Declare C-SEL10 Cursor FOR

SELECT B.RBVOR_VORGANG, C.RBNEW_ACCNT_UID
FROM RBCBAT A,
RBVORT B,
RBNEWT C
WHERE B.RBVOR_VORGANG = A.RBCBA_VORGANG
AND B.RBVOR_MANDINT = A.RBCBA_MANDINT
AND B.RBVOR_SELDAT = A.RBCBA_SELDAT
AND A.RBCBA_UID = C.RBNEW_ACCNT_UID
FOR UPDATE OF C.RBNEW_ACCNT_UID


then using the above cursor delete after fetch

DELETE FROM C
WHERE CURRENT OF C-SEL10

In this case in binding I am getting the SQLCODE = -510

Please suggest how to proceed
Back to top
View user's profile Send private message

rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Thu Jan 03, 2008 2:12 pm    Post subject: Reply to: How to use Update cursor when deleting the row
Reply with quote

Are the Tables declared are native or Remote. If the tables are remote, then -510 occurs during Bind.
Back to top
View user's profile Send private message
lalitsharma_77

New User


Joined: 29 Nov 2007
Posts: 10
Location: Pune

PostPosted: Thu Jan 03, 2008 6:08 pm    Post subject: Reply to: How to use Update cursor when deleting the row
Reply with quote

Hi,

Cursor Update cannot be used if your SELECT statement consist of any one of the follwoing:

ORDER BY
GROUP BY
DISTINCT
JOIN
UNION
AGGREGATE FUNCTIONS


Please correct me if I am wrong.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us