![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion -- Norbert |
#3
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion -- Norbert |
#4
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion -- Norbert |
#5
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion -- Norbert |
#6
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion |
#7
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion |
#8
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion |
#9
| |||
| |||
|
|
Hi, I can't do a create table in a package procedure. A drop jedoch is possible. With google I doesn't find any hint for a necessary privilege. Here is the test package: _____________________________________ CREATE OR REPLACE package DDL_IN_PACKAGE is procedure TestDROP; procedure TestCreate; end DDL_In_Package; / CREATE OR REPLACE package body DDL_IN_PACKAGE is procedure TestDROP is begin execute immediate 'DROP TABLE XXX'; end; procedure TestCreate is begin execute immediate 'CREATE TABLE XXX (a integer)'; end; end DDL_In_Package; / _____________________________________ Here is the code that works: _____________________________________ -- drop TABLE XXX; CREATE TABLE XXX (a integer); begin ddl_in_package.testdrop; -- ddl_in_package.testcreate; end; / Here is the code that fails: _____________________________________ drop TABLE XXX; --CREATE TABLE XXX (a integer); begin -- ddl_in_package.testdrop; ddl_in_package.testcreate; end; / -- ORA-01031: insufficient privileges ORA-06512: at "DDL_IN_PACKAGE", line 10 ______________________________________ Thanks for any suggestion |
#10
| |||
| |||
|
|
Why do you want to do this? In general this is a very bad idea. If you want a "temporary table" in a manner similar to MS SQLServer uses in stored procs then look up global temporary table in the Oracle Docs. A global temporary table is created 1 time not by each user. |
|
Jim |
![]() |
| Thread Tools | |
| Display Modes | |
| |