Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us