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 IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Why TS/OP would Not contact site supp... RahulG31 All Other Mainframe Topics 2 Wed Mar 22, 2017 7:46 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm


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