View previous topic :: View next topic |
Author |
Message |
Solution Beginner
Joined: 15 Feb 2009 Posts: 1 Topics: 1
|
Posted: Tue Feb 24, 2009 11:48 pm Post subject: Sample Dynamic SQL |
|
|
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 |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Thu Feb 26, 2009 5:07 am Post subject: |
|
|
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 |
|
|
|
|