IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cursor Error -504 with 'FOR UPDATE OF' clause


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 355
Location: New York

PostPosted: Wed Aug 08, 2007 2:59 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top