just compile the procedure again and execute it, it'll work properly without any error.
Main Topics
Browse All Topicsi m getting Following Error
1 CREATE OR REPLACE procedure BASE_USER.create_audit_tab
2 is
3 begin
4 execute immediate ('create table base_user.audit_'||i_table
5 dbms_output.put_line(i_tab
6 exception
7 when others then
8 dbms_output.put_line(sqler
9 dbms_output.put_line ('create table ' || i_table_name || '_AUDIT as select * from ' || i_table_
10* end;
SQL> r
1 CREATE OR REPLACE procedure BASE_USER.create_audit_tab
2 is
3 begin
4 execute immediate ('create table base_user.audit_'||i_table
5 dbms_output.put_line(i_tab
6 exception
7 when others then
8 dbms_output.put_line(sqler
9 dbms_output.put_line ('create table ' || i_table_name || '_AUDIT as select * from ' || i_table_
10* end;
Procedure created.
SQL> sho errors
No errors.
SQL> execute create_audit_table('A');
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> execute create_audit_table('A');
ORA-01031: insufficient privileges
create table A_AUDIT as select * from A
PL/SQL procedure successfully completed.
SQL>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I took the following information from the Toad Help
"........
The syntax to support this feature is simple. You add the following clause before your IS or AS keyword in the program header:
AUTHID CURRENT_USER
Here, for example, is a generic run DDL engine that relies on the new Oracle 8.1 native dynamic SQL statement EXECUTE IMMEDIATE and the invoker rights model:
CREATE OR REPLACE PROCEDURE runddl (ddl_in in VARCHAR2)
AUTHID CURRENT_USER
IS
BEGIN
EXECUTE IMMEDIATE ddl_in;
END;
/
The AUTHID CURRENT_USER clause before the IS keyword indicates that when runddl executes, it should run under the authority of the invoker or current user, not the authority of the definer. If you do not include the AUTHID clause or if you include it and explicitly request definer rights as shown:
AUTHID DEFINER
then all references in your program will be resolved according to the directly granted privileges of the owning schema.
....."
Business Accounts
Answer for Membership
by: sonicefuPosted on 2009-01-27 at 17:56:19ID: 23483009
following is the corrected code
just add AUTHID CURRENT_USER before is
Select allOpen in new window