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
 

 

error in a cursor with subquery and group by clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: error in a cursor with subquery and group by clause
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: Chennai

PostPosted: Fri Aug 03, 2007 11:12 am    Post subject: Re: error in a cursor with subquery and group by clause
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    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 OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


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