ORA-01031 on create sequence with Execute Immediate

I have the following statement in a procedure:
EXECUTE IMMEDIATE
  ' CREATE SEQUENCE my_seq
    INCREMENT BY 1
    START WITH 130224
    NOMINVALUE
    NOMAXVALUE
    NOCYCLE
    NOCACHE';
When the statement is executed, I get an ORA-01031: insufficient privileges error.

I can run the CREATE statement in sqlplus. The schema from which I executed the CREATE statement is the same as that under which the procedure is run. In addition, the procedure is also created in the same schema.

What a privilege I'm missing?

Your privilege CREATE SEQUENCE given to you through a role.

Roles are not considered in the stored procedures, you must have the privilege granted directly to your user name.

Tags: Database

Similar Questions

  • FORALL with EXECUTE IMMEDIATE

    Hi all

    I'm using Oracle 11 g Release2.

    I need to use the forall with EXECUTE IMMEDIATE statement and the content of string inside EXECUTE IMMEDIATE is a SELECT instead of the usual DML statement.

    Objective: In this SELECT statement, I'll be passing of data using the "USING" clause in FORALL statement

    When I try to use it, am getting error found "no DATA".

    Please advice if I use FORALL and EXECUTE IMMEDIATE on a SELECT statement?

    I can share the scenario...

    Thank you!

    >
    Please advice if I use FORALL and EXECUTE IMMEDIATE on a SELECT statement?
    >
    No - you can't. See the specifications of the PL/SQL language
    http://docs.Oracle.com/CD/E14072_01/AppDev.112/e10472/forall_statement.htm
    >
    dml_statement

    An INSERT, UPDATE, or DELETE static or dynamic statement making reference at least a collection in its VALUES or the WHERE clause. Performance benefits apply only to references to the collection that use as an index index_name.

  • How to create and insert data with Execute Immediate?

    Hi guys

    Am stuck on a procedure of formatting in a package... script works okay however integrating a module turns out to be difficult!

    Am not used to oracle... I have the script runs, but not in the package... Well not all that... Drop Table worked

    CREATE or REPLACE PACKAGE BODY is

    PROCEDURE DropTable1 IS

    BEGIN

    run immediately ("DROP TABLE mytable1");

    END;

    PROCEDURE PopulateTable1 IS

    BEGIN

    immediately execute ('CREATE TABLE mytable1 )

    AS LONG AS)

    Select

    substr (T1.genarea, 3, 3) as M_Class,

    substr (T1.genarea, 6, 30) as M_Description,

    substr (T1.genarea, 36, 3) as M_Class,

    substr (T1.genarea, 39, 30) as M_Description,

    substr (T1. ItemItem, 1, 3) as product_code,.

    T3. CHANNEL_NUM as SALES_CHANNEL,

    to_date(''t2.time_id'',''dd-mon-yyyy'') as mis_date,

    Sum (T2.ap_cw_cfi_irp + T2.ap_cw_issues_irp) as ap_gross,

    sum (t2. Ap_Cw_Cfi_Irp + t2. Ap_Revivals_Irp) as ap_net,

    Sum (T2.sp_inc_irp + T2.sp_issues_irp) as sp_gross,

    Sum (T2.sp_dec_irp + T2.sp_fs_irp) as sp_net

    Of

    d_pr t1, t2 age_map t3 law

    where

    T1.pfx = "WE"and t1.coy ="1" and t1.tabl = "T81" and substr (t1.itemitem, 1, 3) = t2.product_id and t3. AGE_NUM = t2.age_id

    Group

    substr (T1.genarea, 3, 3),

    substr (T1.genarea, 6, 30),

    substr (T1.genarea, 36, 3),

    substr (T1.genarea, 39, 30),

    substr (T1. ItemItem, 1, 3).

    T3. CHANNEL_NUM,

    to_date(''t2.time_id'',''dd-mon-yyyy'')

    )');

    COMMIT;

    END PopulateTable1;

    END test;

    /

    Thank you

    Hello

    a few notes.

    1. to_date(t2.time_id,'dd-mon-yyyy')

    New York T2.Time_ID Cis the varchar2 data type that contains values to JJ-me-YYYY format?

    And if, in which language is used for the names of the months? Conversions are point impossible to solve in reasonable time limits without logging of dml errors and unique failure on charges of staging nightly!


    2 single quote escaping "alternative in string literals.

    You can use Q or q to escape single quotes in strings.

    http://docs.Oracle.com/database/121/SQLRF/sql_elements003.htm#SQLRF00218

    3. validation

    Not required because the DDL commands commit implied.

    In general I recommend you write commit clauses only in calling script rather than in the code unless it connects with an autonomous transaction.

    You end up with a lot of validation of code here and there and you don't know where it is and where it isn't. That is, your process may have more than one appeal process and commit the middle of the process, it is not atomic processes.

    Here's the demo although I recommend also using the static table and truncate to efficiency. ETG is good choice for the purpose of maintenance table.

    create or replace
    package testing is
      procedure staging_one;
    end;
    /
    create or replace
    package body testing is
      --
      procedure staging_one is
        --
        procedure drop_staging_one is
          table_does_not_exist exception;
          pragma exception_init(table_does_not_exist, -00942);
        begin
          execute immediate q'{
            drop table staging_one purge
          }';
        exception when table_does_not_exist then
          return; -- fine
        end;
        --
        procedure create_staging_one is
        begin
          execute immediate q'{
    
            -- remove >>>
            create table staging_one nologging
            as
            select * from dual
            -- <<< remove
    
            /* uncomment >>>
            create table staging_one nologging
            as
            select
              substr(t1.genarea,3,3)                    as m_class,
              substr(t1.genarea,6,30)                   as m_description,
              substr(t1.genarea,36,3)                   as m_class,
              substr(t1.genarea,39,30)                  as m_description,
              substr(t1.itemitem,1,3)                   as product_code,
              t3.channel_num                            as sales_channel,
              to_date(t2.time_id,'dd-mon-yyyy')         as mis_date,
              sum(t2.ap_cw_cfi_irp+t2.ap_cw_issues_irp) as ap_gross,
              sum(t2.ap_cw_cfi_irp+t2.ap_revivals_irp)  as ap_net,
              sum(t2.sp_inc_irp   +t2.sp_issues_irp)    as sp_gross,
              sum(t2.sp_dec_irp   +t2.sp_fs_irp)        as sp_net
            from
              d_pr t1,
              act t2,
              age_map t3
            where
              t1.pfx                      = 'IT'
              and t1.coy                  = '1'
              and t1.tabl                 = 'T81'
              and substr(t1.itemitem,1,3) = t2.product_id
              and t3.age_num              = t2.age_id
            group by
              substr(t1.genarea,3,3),
              substr(t1.genarea,6,30),
              substr(t1.genarea,36,3),
              substr(t1.genarea,39,30),
              substr(t1.itemitem,1,3),
              t3.channel_num,
              to_date(t2.time_id,'dd-mon-yyyy')
            <<< uncomment */
          }';
          --
        end;
      -- main
      begin
        drop_staging_one;
        create_staging_one;
      end;
    end;
    /
    
    set serveroutput on
    
    exec testing.staging_one;
    
    select * from staging_one
    ;
    commit
    ;
    
    PACKAGE TESTING compiled
    PACKAGE BODY TESTING compiled
    anonymous block completed
    DUMMY
    -----
    X 
    
    committed.
    
  • ORA-01031 error creating table

    I use DB 11g on Wn 2008 Server 64 bit. I run the following creation script:

    CREATE THE TABLE SUPPCHAIN. COUNTRIES (COUNTRY_ID, REGION_ID NUMBER NOT NULL, C
    COUNTRY VARCHAR2 (32) NOT NULL, CODE CHAR (2) NOT NULL, NUMBER OF THE POPULATION, THE AREA N
    UMBER, FXCODE CHAR (3), VARCHAR2 (32) OF CURRENCY, RATES FLOAT (126), PRIMARY KEY (COUN
    TRY_ID) VALIDATE, VALIDATE UNIQUE (COUNTRY), INVALID (CODE) UNIQUE, FOREIGN
    KEY (REGION_ID) REFERS TO SUPERAD. REGION (REGION_ID) VALIDATE)

    Get the following error

    ERROR on line 1:
    ORA-01031: insufficient privileges

    I know it has to do with foreign key references, but I do not know what privileges to set to allow the above run correctly.

    I put CREATE TABLE privileges for user SUPPCHAIN. User SUPERAD also has these privileges and the SYSDBA. So what other privileges should I create?


    Thanks, J

    Jay wrote:
    I use DB 11g on Wn 2008 Server 64 bit. I run the following creation script:

    CREATE THE TABLE SUPPCHAIN. COUNTRIES (COUNTRY_ID, REGION_ID NUMBER NOT NULL, C
    COUNTRY VARCHAR2 (32) NOT NULL, CODE CHAR (2) NOT NULL, NUMBER OF THE POPULATION, THE AREA N
    UMBER, FXCODE CHAR (3), VARCHAR2 (32) OF CURRENCY, RATES FLOAT (126), PRIMARY KEY (COUN
    TRY_ID) VALIDATE, VALIDATE UNIQUE (COUNTRY), INVALID (CODE) UNIQUE, FOREIGN
    KEY (REGION_ID) REFERS TO SUPERAD. REGION (REGION_ID) VALIDATE)

    Get the following error

    ERROR on line 1:
    ORA-01031: insufficient privileges

    I know it has to do with foreign key references, but I do not know what privileges to set to allow the above run correctly.

    I put CREATE TABLE privileges for user SUPPCHAIN. User SUPERAD also has these privileges and the SYSDBA. So what other privileges should I create?

    Thanks, J

    GRANT REFERENCES ON SUPERAD. SUPPCHAIN REGION;

  • Need help with EXECUTE IMMEDIATE

    I'm tring to issue an EXECUTE IMMEDIATE to create a DIRECTORY. My problem is that I'm in the "'... ''...'' '...'' ' mess!

    source_instance VARCHAR2 (30);
    Select sys_context ('USERENV', 'DB_NAME') in the double source_instance;

    IMMEDIATE EXECUTION
    ' CREATE OR REPLACE DIRECTORY "DATA_HUB_". source_instance LIKE "/ mnt/smb/share/layout scene/DataHub /" | source_instance';

    I am hopeing to get:
    CREATE or REPLACE DIRECTORY DATA_HUB_MYDB AS ' / mnt/smb/share/layout DataHub/scene/MYDB ";

    I'm on Oracle 11.1


    Thank you!

    I wonder why people do not use q' syntax. It was introduced in 10g

       EXECUTE IMMEDIATE q'#CREATE OR REPLACE DIRECTORY DATA_HUB_#' || source_instance || q'# AS '/mnt/smb/share/Staging/DataHub/#' || source_instance || q'#'#'; 
    

    Concerning

    Pavol Babel

  • ORA-00904 on CREATE TABLE with a virtual column based on the XMLTYPE content

    Hello

    This is another one for the gurus of the syntax...

    Try the following, fails with ORA-00904: "MESSAGE". "' GETROOTELEMENT": invalid identifier
    CREATE TABLE XML_TEST_VIRT
      (
       MSG_TYPE         GENERATED ALWAYS AS (MESSAGE.GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
      )
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /
    While it succeeds
    CREATE TABLE XML_TEST_VIRT
      (
       MSG_TYPE         GENERATED ALWAYS AS (EXTRACT(MESSAGE, '/*').GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
      )
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /
    The GETROOTELEMENT from SYS member function. XMLTYPE is stated as "PARALLEL_ENABLE DETERMINISTIC" the method called is not the problem, as evidenced by the 2nd case.
    Using the MESSAGE column that is of type XMLTYPE directly seems to be the problem. But the question is "why." The result of the EXTRACT function is of type XMLTYPE and call his works of members, the column is also of type XMLTYPE still call its members fails...

    Thanks in advance for any ideas on that.

    Best regards
    Philippe

    Going on the means to go far, far back.

    2003 re: function getRootElement ORA-00904

  • With the help of the POLL with Execute Immediate clause

    I wrote a query to update a table and return the column in a variable of type table nested using the return clause but its not working, I am getting error like

    ORA-06550: line 66, column 22:
    PLS-00306: wrong number or types of arguments in the call to ' |'
    ORA-06550: line 66, column 4:
    PL/SQL: Statement ignored

    I get the error message in part of my request to the suite

    || "RETURN If_row_status in bulk collect INTO"
    || v_if_row_status;


    Referred to as v_if_row_status-
    TYPE v_count IS the TABLE OF varchar2 (50) INDEX directory.
    v_if_row_status v_count;

    The original message listed error about concatenation, but the code in response to scott.wesley had no concatenation. Have you tried to revise the update process? What is a different issue, unrelated to the first?

    The best thing to do would be to create a cursor, loop through it and use a simple update for each row. Updates complex as the one you are trying to use are very difficult to manage. By using a loop to insert/update, you can have control over the process and have access to all values, you must use more later in advance instead of having to use the RETURN clause.

    Insert bulk can be more effective, but is difficult to manage for the great updates.

  • ORA-02289 delete and create sequences to help to run immediately

    Hi all

    I copied a schema of one database to another.
    In the former base my package works very well and the procedure inside the PKG_REFRESH package below works like a charm.

    PROCEDURE FILL_TABLE(P_PROC_ID INTEGER) AS
    BEGIN
    EXECUTE IMMEDIATE (' drop sequence sq1' ");
    EXECUTE IMMEDIATE (' create the sequence sq1 with cache of 1 500 ft);
    v_kenmerk: = 'dim_1 ';
    INSERT INTO dim_1)
    Field1
    Field2
    ... < snip >
    END;

    Now that I have imported the package in a different database, and while footage used by inside the packaging procedures exist, it gives the errors below:

    Start
    *
    LAUGHING at regel 1:
    . ORA-02289: sequence does not exist
    ORA-06512: at "OWNER. PKG_REFRESH", line 117
    ORA-06512: at "OWNER. PKG_REFRESH', line 80
    ORA-01031: insufficient privileges
    ORA-06512: at "OWNER. PKG_REFRESH', line 20
    ORA-06512: at line 3 level

    I checked and the sequence is abandoned, but has not been recreated. However, it only gives me an error message when you try to create the sequence.
    I'm puzzled... search this forum, google and metalink did not help me either.

    Does anyone have an idea why this is happening? Strange is that it does not work on the old database.

    Robin

    Published by: RobbieNerve on June 30, 2011 10:27 I forgot to say that the procedure is inside the package

    Try to give an explicit subsidy to the user:

    GRANT CREATE SEQUENCE TO OWNER;
    

    Max

  • Execute Immediate is not working well

    We need to find tables with the same name and columns but these columns whose data type is different. The SQL below detects the difference.
    select a.table_name, a.column_name, 
    a.data_type ||'---> '||a.owner BASE_SCHEMA_TYPE, 
    b.data_type ||'---> '||B.owner COMPARED_SCHEMA_TYPE 
    from all_tab_columns a, all_tab_columns b  where a.owner =
    'SCOTT' and b.owner = 'HR'  and a.table_name=b.table_name and
    a.column_name=b.column_name and a.data_type!=b.data_type
    Based on the SQL above, I created the procedure mentioned below which takes a base as input parameter schema and find these tables with the same name but have different data type columns. It generates dynamic SQL code properly (you can see in DBMS_OUTPUT) but for some reason, the INSERT is not the case with EXECUTE IMMEDIATE. No idea why?
    create or replace procedure admin.compare_data_types (p_baseschema in varchar2)
    is
    v_sql   varchar2(2000);
    begin
    
    delete from admin.differences;
    commit;
    
    for rec in (select  username from  dba_users where Username IN ( 'HR'))
    loop
    
      v_sql := 'insert into admin.differences select a.table_name, a.column_name, a.data_type ||''---> ''||a.owner BASE_SCHEMA_TYPE, b.data_type ||''---> ''||B.owner COMPARED_SCHEMA_TYPE from all_tab_columns a, all_tab_columns b      where a.owner = '''||p_baseschema||''' and b.owner = '''||rec.username||'''  and a.table_name=b.table_name and a.column_name=b.column_name and a.data_type!=b.data_type';
         
         dbms_output.put_line (v_sql);
         execute immediate v_sql;
         --commit; -- Doesn't make any difference
         --v_sql := null; -- Doesn't make any difference
         
    
    
    end loop;
    commit;
    
    end compare_data_types;
    Structure of the table being INSERT ed
    create table admin.DIFFERENCES
    (
      TABLE_NAME           VARCHAR2(200),
      COLUMN_NAME          VARCHAR2(200),
      BASE_SCHEMA_TYPE     VARCHAR2(100),
      COMPARED_SCHEMA_TYPE VARCHAR2(100)
    )

    How about putting in a debug message to see what he does...

    (don't forget to ' set serveroutput we "before...)

    create or replace procedure admin.compare_data_types (p_baseschema in varchar2)
    is
    v_sql   varchar2(2000);
    begin
    
    delete from admin.differences;
    commit;
    
    for rec in (select  username from  dba_users where Username IN ( 'HR'))
    loop
    
    insert into admin.differences
    select a.table_name
          ,a.column_name
          ,a.data_type ||'---> '||a.owner BASE_SCHEMA_TYPE
          ,b.data_type ||'---> '||B.owner COMPARED_SCHEMA_TYPE
      from all_tab_columns a
          ,all_tab_columns b
     where a.owner          = p_baseschema  -- Procedure Paramater
       and b.owner          = rec.username
       and a.table_name     = b.table_name
       and a.column_name    = b.column_name
       and a.data_type!=b.data_type;
    
     dbms_output.put_line('Rows Inserted for '||rec.username||': '||sql%rowcount);
    end loop;
    commit;
    
    end compare_data_types;
    

    And see if it is one) enter the loop and b) the number of rows is inserted during the process.

    If it displays 0 rows inserted, then there's something of logically wrong with your select statement, as is return nothing.

  • EXECUTE IMMEDIATE or DBMS_UTILITY. EXEC_DDL_STATEMENT

    Hello

    I recently became aware of DBMS_UTILITY. EXEC_DDL_STATEMENT and I was wondering if it works in pretty much the same way as EXECUTE IMMEDIATE. I'm guessing that EXECUtE IMMEDIATE offers more flexibility when putting together the command you want to run, but you are the only real difference? All opinions accepted with gratitude,

    Kind regards

    Kevin.

    This isn't an exact answer to your question, but it may be useful.

    Execute Immediate is the approach privileged 9i or higher. If you decide which to use, go with EXECUTE IMMEDIATE. You never know when the other dynamic SQL methods will be deprecated. In addition, EXECUTE IMMEDIATE has also been optimized (and will continue to be optimized), so you can usually expect better performance during use.

    The exact differences between EXECUTE IMMEDIATE and DBMS_UTILITY. EXEC_DDL_STATEMENT go, I can't give you an exact answer. (Also the fact that DBMS_UTILITY. EXEC_DDL_STATEMENT DDL is, of course).

    You may or may not find this article helpful: http://okjsp.pe.kr/seq/9789. He did a good job to compare the differences between EXECUTE IMMEDIATE and another way inherited to the dynamic SQL statements (DBMS_SQL. RUN)

    Bob

  • Execute Immediate with DOF and TABLE() - error ORA-22905

    Hello

    I have a problem trying to use a user defined the Type of the Table in a statement Execute Immediate containing a CREATE TABLE statement.

    Is there no work around for this problem?

    The actual code for the SELECT * OF TABLE(:T) is dynamic and slow. That's why I try to avoid to create/fill the table in two steps (as does with MY_TABLE1). Also, in this case, I can't use SELECT * but must specify all the columns (amount variable and over 100 columns).

    CREATE TYPE MY_TABLE_TYPE AS TABLE OF VARCHAR2(30);
    /
    DECLARE
        MT MY_TABLE_TYPE;
    BEGIN
        SELECT * BULK COLLECT INTO MT FROM DUAL;
        -- Two steps
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE1 (A VARCHAR2(30))';
        EXECUTE IMMEDIATE 'INSERT INTO  MY_TABLE1    SELECT * FROM TABLE(:T)' USING MT; -- OK
        -- One step
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE(:T)' USING MT; -- ERROR ORA-22905   
    END;
    /
    

    byee

    Andrea

    In my view, the error message is incorrect or the less misleading. Bind variables cannot be used in DDL:

    SQL > declare
    2 number of v_var: = 99;
    3. start
    4 run immediately "' create the my_table2 in select table: double T" using v_var; "
    5 end;
    6.
    declare
    *
    ERROR on line 1:
    ORA-01027: bind variable not allowed for data definition operations
    ORA-06512: at line 4 level

    SQL >

    What you could do is use the package variable:

    SQL > CREATE OR REPLACE
    2 PACKAGE PKG1
    3 EAST
    4 MT MY_TABLE_TYPE;
    5 FUNCTION GET_MT
    6 RETURN MY_TABLE_TYPE;
    7 END;
    8.

    Package created.

    SQL > CREATE OR REPLACE
    PACKAGE 2 BODY PKG1
    3 EAST
    4 GET_MT FUNCTION
    5 RETURN MY_TABLE_TYPE
    6 EAST
    7. START
    8 RETURN MT;
    9 END;
    10 END;
    11.

    Package body created.

    SQL > DROP TABLE MY_TABLE1 PURGE
    2.

    Deleted table.

    SQL > DROP TABLE MY_TABLE2 PURGE
    2.
    DROP TABLE MY_TABLE2 PURGE
    *
    ERROR on line 1:
    ORA-00942: table or view does not exist

    SQL > START
    2. SELECT * BULK COLLECT INTO PKG1.MT FROM DUAL;
    3 - two steps
    4 RUN IMMEDIATELY "CREATE TABLE MY_TABLE1 (A VARCHAR2 (30))';"
    5 IMMEDIATELY EXECUTE "INSERT INTO MY_TABLE1 SELECT * FROM TABLE (PKG1." GET_MT)';
    6 - one step
    7 IMMEDIATE EXECUTION "CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE (PKG1." GET_MT)';
    8 END;
    9.

    PL/SQL procedure successfully completed.

    SQL > select * from my_table1;

    A
    ------------------------------
    X

    SQL > select * from my_table2;

    COLUMN_VALUE
    ------------------------------
    X

    SQL >

    SY.

  • CREATE a USER Oracle 12 c fails with ORA-01031 (insufficient privileges)

    I work with a client to start the test 12 c with an application.

    User logged into the database by using both "/ as sysdba" and "xxxxxxx/sys as sysdba.

    However, doing so CREATE USER someuser IDENTIFIED BY somepass;

    insufficient privileges ORA-01031 auto fails.

    I don't see an obvious reason why this does not work, and it works on my own system. Any ideas are appreciated.

    He said he was using a traditional database (no plug-in) wrong after previously created a pluggable.

    Daryl

    by chance, do you have database Vault (figure DVSYS) installed in your database? According to default manual installation program prevents you to create the user if data vault is configured.

    http://docs.Oracle.com/CD/B28359_01/server.111/b31222/DB_objects.htm

    Oracle Database Vault | Oracle database | Oracle

    Oracle Database Vault allows customers to avoid excesses in controlling the use of commands such as ALTER SYSTEM, ALTER USER, DROP USER, CREATE USER, etc.

    In addition, check this box

    "Create a user" gives ORA-01031: not sufficient privileges to user sys

  • Create the Select sequence with the request number

    Hi all

    I would like to create a sequence number in oracle, but instead of coding hard 'start with' I want to choose the max value of the primary key of a table and add 1 and use it instead:

    So what I want is:
    CREATE SEQUENCE crg_mrec_seq
    MINVALUE 1
    MAXVALUE 999999999999999999999999999
    START WITH select max(primarykey)+1 from table1
    INCREMENT BY 1
    CACHE 20;
    I guess I have to spend this max value as a variable in the create sequence number, but I'm not sure of the syntax to use.

    Thank you
    Ed

    Hello

    The START WITH value must be a literal NUMBER. You need dynamic SQL statements to do what you asked.
    EXECUTE IMMEDIATE, as mentioned above, is a way to make the dynamic SQL statements.
    In SQL * Plus, the substitution variables are another.

    COLUMN     first_num_col     NEW_VALUE first_num
    
    SELECT  MAX (primarykey) + 1        AS first_num_col
    FROM      table1;
    
    CREATE SEQUENCE crg_mrec_seq
    MINVALUE 1
    MAXVALUE 999999999999999999999999999
    START WITH  &first_num
    INCREMENT BY 1
    CACHE 20;
    
  • Grant create session, grant no privilege to aquser-&gt; ORA-01031?

    Hello

    How can it be possible that despite all the privileges a user always generates ORA-01031: insufficient privileges?

    Grant create session, granted a privilege of aquser


    Dequeue messages with java->

    oracle.jms.AQjmsException: JMS-120: Homtningen Fron k÷n utf÷rdes inte
    at oracle.jms.AQjmsError.throwEx(AQjmsError.java:315)
    at oracle.jms.AQjmsConsumer.jdbcDequeue(AQjmsConsumer.java:1630)
    at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:1037)
    at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:962)
    at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:940)
    at oracle.jms.AQjmsConsumer.receive(AQjmsConsumer.java:792)
    at AQSub.AQReceiver (AQSub.java:188)
    at AQSub.eval (AQSub.java:130)
    at com.tibco.im.wf.Job.step(Job.java:986)
    at com.tibco.im.wf.Job.checkStep(Job.java:822)
    to com.tibco.im.wf.NewJobDispatcher$ JobCourier.runx (NewJobDispatcher.java:240)
    to com.tibco.im.wf.NewJobDispatcher$ JobCourier.run (NewJobDispatcher.java:207)
    Caused by: java.sql.SQLException: ORA-01031: otillrocklig beh÷righet

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
    at oracle.jdbc.driver.T4Caqdq.receive(T4Caqdq.java:431)
    at oracle.jdbc.driver.T4CConnection.doDequeue(T4CConnection.java:3369)
    at oracle.jdbc.driver.PhysicalConnection.dequeue(PhysicalConnection.java:9142)
    at oracle.jdbc.driver.PhysicalConnection.dequeue(PhysicalConnection.java:9189)
    at oracle.jms.AQjmsConsumer.jdbcDequeue(AQjmsConsumer.java:1305)
    ... more than 10

    GRANT CREATE SESSION, aq_user_role to my_aq_user_role.

    Well, have you seen this?

    4.2.1.2 the user role
    You should avoid granting AQ_USER_ROLE, because this role provides enough privileges to the queue or the print queue on the 8, 1-style queues or superiors.

    Since you have not provided no version information, it's a little hard to know if it is applicable to your case. However, this should be a case of applying logic/troubleshooting/debugging skills to determine what privileges are missing.

    Kind regards

    Mark

    EDIT: I realize that you have explicitly granted the privileges ENQUEUE_ANY and DEQUEUE_ANY, but have you followed the other suggestions EXECUTE, for example right on DBMS_AQ?

    Published by: Mark Williams on May 28, 2010 11:37

  • ORA-01031: insufficient privileges on run immediately 'create a table... '. »

    Hello. I created a stored procedure that starts an immediate execution "create table..." Responses to Oracle with the message ' ORA-01031: insufficient privileges.

    I solved the problem adding 'authid current_user is' in the procedure declaration.

    Unfortunately, if I try to plan his by DBMS_JOB, responses to oracle with the same error again.

    Why? And how can I avoid it?

    Thank you very much in advance

    Published by: user4501018 on 6-mag-2010 4.00

    user4501018 wrote:

    Unfortunately, if I try to plan his by DBMS_JOB, responses to oracle with the same error again.

    Add:

    run immediately "role play all THE ';"

    before immediate 'create table..."

    SY.

Maybe you are looking for

  • No sound @ Linux Mint 17

    Guys I just installed cost LM 17 on my computer. I have no sound in Skype.In the audio settings for Skype, there are "Pulseaudio Server (local)" in all devices.I installed pulseaudio, paprefs pavucontrol, pavumeter.I reinstalled the kernel.I have no

  • Do you know if you can acquire data from a microcontroller that runs under the PLUS + 1 environment, using the NI 9201 platform?

    Hello world Do you know if you can acquire data from a microcontroller that runs under the PLUS + 1 environment, using the NI 9201 platform? I need to build a test environment in labview, but entries must be purchased from the microcontroller MC02401

  • Editing photos in my pictures.

    I lost the toolbar in my pictures that allows me to reframe, balance, resize, correct (x degrees rotation).  It has been replaced by a very limited set of options along the base of the page.  How can I return the toolbar?

  • Windows 7 Desktop

    I have a dell Windows 7 Desktop top, 2 GB. Can I upgrade to windows 10 and can I increase to 4 or 6 GB?

  • Cannot connect to Games For Windows Live

    I used to connect, but now I can't connect to Games for Windows Live in Resident Evil 5. Here are the steps I've tried and have failed. Sync would have time with internet time. Assigned a static IP in my router and forwarded the ports UDP 88 and TCP/