Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us