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
 

 

Cursor Error -504 with 'FOR UPDATE OF' clause

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

New User


Joined: 14 Mar 2006
Posts: 39

PostPosted: Tue Aug 07, 2007 4:29 am    Post subject: Cursor Error -504 with 'FOR UPDATE OF' clause
Reply with quote

Hi,

Will the 'FOR UPDATE OF' clause work when the Cusror declared has the join of more than one than one table? Because i'am gettin a -504 (Cursor Name is Not defined) when i'am trying to bind the application program .I've checked the program and the Cursor is declared.

I've declared a Cursor as

EXEC SQL
DECLARE CSR1 CURSOR FOR
SELECT A.Column2,A.Column3,B.column4
FROM Table1 A,
Table2 B
Where A.Column1=B.column1
For Update of Column2,Column3
END-EXEC


and my update clause is

EXEC SQL
UPDATE Table1
SET Column2 = 'ABCD'
, Column3 = '12345'
WHERE CURRENT OF CSR1
END-EXEC.

Thanks in advance
Back to top
View user's profile Send private message

ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Wed Aug 08, 2007 2:59 pm    Post subject: Re: Cursor Error -504 with 'FOR UPDATE OF' clause
Reply with quote

As for as I know FOR UPDATE clause cannot be used in the following scenarios.

1) If the cursor associated with the SELECT statement cannot be deleted.

2) If at least one of the selected columns is a column that cannot be updated in a catalog table and has not been excluded in the FOR UPDATE clause.

Just check whether the above cases are existing in your cursor.

Regards,
ksk
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 DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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