View previous topic :: View next topic
|
Author |
Message |
catchyblues
New User
Joined: 28 Dec 2005 Posts: 24
|
|
|
|
I've coded the following cursor declaration in Procedure Division. DSUNT001.V_BII_CVR_ITEM_CUR is a view on which i'm trying to use a cursor.
Code: |
EXEC SQL
DECLARE ITEM_CSR CURSOR FOR
SELECT
COVER_ITEM_ID,
COVER_ITEM_NO,
SEQ_ALPHA,
SEQ_ROMAN
FROM DSUNT001.V_BII_CVR_ITEM_CUR
WHERE
FK_COV_ITEMGRP_ID = :W04-VAR-CIG
END-EXEC |
I'm getting the following error during DB2 SQL PRECOMPILE for the Open Cursor statement.
DSNH504I E DSNHSMUD LINE 1160 COL 27 CURSOR "ITEM_CSR" WAS NOT DECLARED
I have checked the select statement in SPUFI and it works perfectly fine. I also have another cursor declared in the same program but for a different table and even that is error free in Pre-Compile.
Can anyone tell me where I mite be making a mistake ?
cheers
CB |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Do you have some other code that successfully gets thru the precompiler that also uses that view?
If you post more of your code that may help - especially before and after line 1160. What does the precompiler show for the problem cursor declaration? What does the precompiler show for the successful declaration?
My guess is that there is a typo we've not seen here or there is something amiss with that particular view. |
|
Back to top |
|
|
veerababu_p
New User
Joined: 18 Mar 2006 Posts: 5 Location: mumbai
|
|
|
|
Please code in working storage insted of procedure division. |
|
Back to top |
|
|
catchyblues
New User
Joined: 28 Dec 2005 Posts: 24
|
|
|
|
got this fixed now....... problem is due to the column where I
started the EXEC SQL for the declare cursor.....
thnx once again....
dick scherrer wrote: |
Hello,
Do you have some other code that successfully gets thru the precompiler that also uses that view?
If you post more of your code that may help - especially before and after line 1160. What does the precompiler show for the problem cursor declaration? What does the precompiler show for the successful declaration?
My guess is that there is a typo we've not seen here or there is something amiss with that particular view. |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome.
Thanks for posting the solution |
|
Back to top |
|
|
|