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 Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
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 INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am


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