![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hello, i am having trouble creating tables from a package using oracle 10g. i am logged in as user 'testuser' and am working in the users schema 'testuser' where the user is allowed to perform CREATE TABLE statements, also the EXECUTE right is granted. but when i execute a package with a statement like EXECUTE IMMEDIATE 'CREATE TABLE ...'; i receive a ORA-01031 (insufficient privileges). if i execute the create statement from an editor window the table will be successfully created since i am granted CREATE TABLE. it looks like the grants of the users session are changed when i am inside a package, but i am wondering why this should make any sense and how i can get the GRANTS to work inside a package too. any ideas? help would be highly appreciated! AndiZed |
#4
| |||
| |||
|
|
Hello, i am having trouble creating tables from a package using oracle 10g. i am logged in as user 'testuser' and am working in the users schema 'testuser' where the user is allowed to perform CREATE TABLE statements, also the EXECUTE right is granted. but when i execute a package with a statement like EXECUTE IMMEDIATE 'CREATE TABLE ...'; i receive a ORA-01031 (insufficient privileges). if i execute the create statement from an editor window the table will be successfully created since i am granted CREATE TABLE. it looks like the grants of the users session are changed when i am inside a package, but i am wondering why this should make any sense and how i can get the GRANTS to work inside a package too. any ideas? help would be highly appreciated! AndiZed |
#5
| |||
| |||
|
|
On Dec 8, 8:22 am, andi... (AT) gmx (DOT) net wrote: Hello, i am having trouble creating tables from a package using oracle 10g. i am logged in as user 'testuser' and am working in the users schema 'testuser' where the user is allowed to perform CREATE TABLE statements, also the EXECUTE right is granted. but when i execute a package with a statement like EXECUTE IMMEDIATE 'CREATE TABLE ...'; i receive a ORA-01031 (insufficient privileges). if i execute the create statement from an editor window the table will be successfully created since i am granted CREATE TABLE. it looks like the grants of the users session are changed when i am inside a package, but i am wondering why this should make any sense and how i can get the GRANTS to work inside a package too. any ideas? help would be highly appreciated! AndiZed Why would you want to do this in the first place? this is just dangerous practice. Don't do it. Ed |
#6
| |||
| |||
|
|
it was part of a package i had to port. the original author said dropping & creating these tables was faster than performing a truncate. |
#7
| |||
| |||
|
|
andi... (AT) gmx (DOT) net wrote: it was part of a package i had to port. the original author said dropping & creating these tables was faster than performing a truncate. I hope you, and everyone else, knows that this statement is unadulterated rubbish. And in a production environment neither solution is the correct one. -- Daniel A. Morgan Oracle Ace Director & Instructor University of Washington damor...@x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Groupwww.psoug.org |
#8
| |||
| |||
|
|
i am wondering whats so wrong about performing a truncate. what would the correct solution look like in your opinion? Thanks, AndiZed |
#9
| |||
| |||
|
|
What is evil & wrong is doing DDL from inside PL/SQL. I wish that Oracle never had created EXECUTE IMMEDIATE to allow such nonsense. |
#10
| |||
| |||
|
|
What is evil & wrong is doing DDL from inside PL/SQL. I wish that Oracle never had created EXECUTE IMMEDIATE to allow such nonsense. DDL in PL/SQL has its uses. How else are you going to write an installation script for database objects which is a) safely re-runnable b) is not allowed to throw any exceptions about already existing objects on re-run Don't have EXCEPTION or IF in pure SQL... |
![]() |
| Thread Tools | |
| Display Modes | |
| |