MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sample Dynamic SQL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Solution
Beginner


Joined: 15 Feb 2009
Posts: 1
Topics: 1

PostPosted: Tue Feb 24, 2009 11:48 pm    Post subject: Sample Dynamic SQL Reply with quote

Hi I have the following Dynamic SQL.Could anybody please let me know the correct answer for this.If I want to test how can I test this any suggestions?

strcpy (qstring,"INSERT INTO EMPLOYEE SELECT *
FROM EMP_ACT WHERE ACTNO >= 100");

EXEC SQL EXECUTE IMMEDIATE :qstring;
The plan is bound with DYNAMICRULES set to BIND. A user has only been granted INSERT authority on the employee table. What

will happen when the sample code above is executed?
A.The insert will fail because the user needs EXECUTE authority on the package.
B.The insert will fail because the user needs CONTROL authority on the package.
C.The insert will fail because the user needs CONTROL authority on the plan.
D.The insert will fail because the user needs EXECUTE authority on the plan.
E.The insert will be successfully completed.
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Thu Feb 26, 2009 5:07 am    Post subject: Reply with quote

Well, you need EXECUTE authority on the plan and the package of every application program you want to run, and executing a dynamic SQL statement is just the same.

The EXECUTE privilege of the plan and package you want to use could of course be granted to PUBLIC.

regards
Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group