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

error in a cursor with subquery and group by clause


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sindu.sagudam

New User


Joined: 02 May 2007
Posts: 8
Location: mumbai

PostPosted: Fri Aug 03, 2007 11:02 am
Reply with quote

Hi all,

I am trying to execute the following query in my program

EXEC SQL DECLARE SRQL-BLOB-PURG CURSOR WITH RETURN FOR SELECT YEAR,MONTH,COUNT(*) AS IMAGES
FROM (SELECT YEAR(A.T_STMP_UPD) AS YEAR,
MONTH(A.T_STMP_UPD) AS MONTH
FROM S.SREQEST A,S.SRQBLOB B
WHERE A.I_REQ = B.I_REQ) PMT
GROUP BY YEAR,MONTH
ORDER BY YEAR DESC,MONTH DESC
END-EXEC.

This query is running fine in spufi.
But in the program with the cursor it is giving a compilation error as below

MISSING VIEW AND/OR PRIVILEGE FOR:



VIEW NAME -> (

PRIVILEGE TYPE -> SELECT

SYSTEM NAME -> DPA

PROGRAM NAME -> DPA0010B

RC=8

* * *

* * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * *



PROCESSING COMPLETE, ERRORS FOUND!

CONTACT YOUR DBA FOR ASSISTANCE!

HIGHEST RC=8

* * * * * * * * * * * * * * * * * * * * * *

Kindly let me know is it a problem due to authorization or some problem with the query.

Thanks and Regards,
Sindu.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Fri Aug 03, 2007 11:12 am
Reply with quote

In SPUFI it is generic.But when you code the SQL in a program and trying to add the program to any system or subsystem in case of endevor the bind access is checked for the table through that system( here it is DPA) .DPA doesn't have bind access to the tables in the SQL so it gets RC.Contact your DBA's and ask them to create a synonym for this system to bind to this table.
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