Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01031: insufficient privileges

user12093849Nov 15 2012 — edited Nov 15 2012
Oracle 10g

I am running the below oracle script through a.sql file. I am runnin thro TEST1 schema and i want the below sequence to be created in TEST2 schema. is there any way we can transfer the schema name in between the procedure?
SET TIMING ON
SET ECHO ON
SET ESCAPE ON
SET SERVEROUTPUT ON SIZE 100000
SET FEEDBACK ON
set timing on
set serveroutput on
WHENEVER SQLERROR EXIT SQL.SQLCODE;

DECLARE
    cursor c1 is select SEQUENCE_NAME from USER_SEQUENCES
             where SEQUENCE_NAME in ('U_TEST');
BEGIN
     for rec in c1 loop
           execute immediate 'DROP SEQUENCE ' || rec.sequence_name;
    end loop;
end;
/


CREATE SEQUENCE TEST2.U_TEST
  MINVALUE 1
  MAXVALUE 999999999999999999999999999
  INCREMENT BY 1
  START WITH 1
  CACHE 100
  NOORDER
  NOCYCLE;

exit 0
I am getting the following error
CREATE SEQUENCE SCPOMGR.U_RPT_MARKET_MOE_SEQ
*
ERROR at line 1:
ORA-01031: insufficient privileges
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2012
Added on Nov 15 2012
6 comments
643 views