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

Tags: Database

Similar Questions

  • How to pass a sequence of 'help' to run immediately

    How can I place a sequence.nxlval as a parameter using, here is my code looks like

    sql_string is-> insert into some_tab (col1, col2,...) (select col1: passed_seq,...) where the... (I want to insert values in sequence for col2)


    and I call it like


    passed_seq: = "seq_". some_dynamic_num |'. nextval' (in my PB will be sequences with the string formed as seq_10.nextval)

    EXECUTE IMMEDIATE sql_string using passes_seq;

    If I do like this I get

    Error: - 1722:ORA - 01722: invalid number seq_10.nextval

    Published by: DIVI on 8 January 2013 07:40

    >
    So is there another way to solve my problem, where queries are already formed and stored in a table in the form of data in the column, and I need to run those from different sequences in different scenarios.
    >
    Yes - you change applications to use a placeholder for the sequence you need (e.g. [SEQ_GOES_HERE]) when you need to run it you create a PL/SQL block into a VARCHAR2 variable, then use run immediately on the variable.

    If your stored query would look like this

    sql_string is -> insert into some_tab (col1,col2, ....) (select col1,[SEQ_GOES_HERE],......) where .... 
    

    Load the good seq.nextval in a variable, and then replace "[SEQ_GOES_HERE]" in the query with this value.

  • ¿Will do a delete and create a new temp.dbf performance increase?

    I have a 32 GB temp file. I do not so understand what really mean that temp.dbf must be so great.

    The question is: can I delete and create a new temp.dbf? and what does this mean?

    I am beginner in this.

    Thank you, Luis.

    Published by: cabezanet on November 23, 2009 09:10

    Of course, delete and re-create the temp tablespace if the size is too large.

    cabezanet wrote:
    You have been very helpful. I guess in your reply that I can do a drop for temp.dbf I suppose that this isn't a problem, but it is not necessary unless the size used by this file is too large.

    Thank you very much!

    PS: But I see no marks on my post :)

  • drive appears as a drive system, but it is not. I deleted and created a new O drive, but Windows 7 backup insists that it is a system drive!

    drive appears as a drive system, but it is not. I deleted and created a new O drive, but Windows 7 backup insists that it is a system drive!

    Hello

    Backup to a different partition on the same drive is not recommended and the car fails, you will not be able to retrieve or use the backup.

  • How can I create VI with inputs that run immediately when the update?

    I'm using LabView for controlling stepper motors. I would create a VI with a front panel that has 4 arrows, 2 per engine. My goal is to be able to run the VI and then press a button to move the engine.

    I created separate VI for each funcition of engines - one vi to set current operations, to determine the current travel, another to move up by a certain amount and so on. Work of these vi and I can move and adjust engines, but only by running separate VI.

    How can I combine them into a single VI and make them run to the pressure of a button or the change of a property? An example would be to establish a new current holding company and place the operation current vi run immediately and send the order to the engine. Then continue to press the arrow keys without having to hit 'run' on an another vi.

    Thank you very much


  • How to create a stored procedure to delete and create table

    Version: Oracle 10g

    I am trying to create a stored procedure that is delete it and create a table based on a select statement. I can create the table, but I can't let it go.

    CREATE or REPLACE procedure EC_LOAD is
    Start
    INSERT INTO Sales_table
    (FSCL_WK,
    DIV,
    ACCT_TYPE)
    Select
    FSCL_WK,
    DIV,
    ACCT_TYPE
    Of
    sales_revenue;
    end ecload;

    I need to drop the Sales_table before inserting the values. How can I do this?

    user610131 wrote:

    I need to drop the Sales_table before inserting the values. How can I do this?

    If you drop off where you insert it :)? Do you mean DELETE or TRUNCATE?

    If table can be truncated (and don't forget TRUNCATE is DDL then he will commit):

    CREATE OR REPLACE procedure EC_LOAD is
    begin
    EXECUTE IMMEDIATE 'TRUNCATE TABLE Sales_table';
    INSERT INTO Sales_table
    (FSCL_WK,
    DIV,
    ACCT_TYPE)
    Select
    FSCL_WK,
    DIV,
    ACCT_TYPE
    from
    sales_revenue;
    end ecload;
    

    Otherwise, use DELETE:

    CREATE OR REPLACE procedure EC_LOAD is
    begin
    DELETE Sales_table;
    INSERT INTO Sales_table
    (FSCL_WK,
    DIV,
    ACCT_TYPE)
    Select
    FSCL_WK,
    DIV,
    ACCT_TYPE
    from
    sales_revenue;
    end ecload;
    

    SY.

  • Oracle 11G copy a table to help to run immediately

    I want to copy the contents of a table in another aid to run immediately.

    It keeps fails with the following error

    ORA-00903: invalid table name
    ORA-06512: at "TABLE_COPY", line 6
    ORA-06512: at line 8 level



    create or replace
    procedure TABLE_COPY)
    Table1 varchar2,
    Varchar2 TABLE2)
    is
    Start
    run immediately 'insert'. TABLE2. "(select * from ' |) TABLE1 |') ' ;
    end;

    Published by: user9213000 on January 24, 2013 07:38

    user9213000 wrote:
    I want to copy the contents of a table in another aid to run immediately.

    It keeps fails with the following error

    ORA-00903: invalid table name
    ORA-06512: at "TABLE_COPY", line 6
    ORA-06512: at line 8 level

    create or replace
    procedure TABLE_COPY)
    Table1 varchar2,
    Varchar2 TABLE2)
    is
    Start
    run immediately 'insert'. TABLE2. "(select * from ' |) TABLE1 |') ' ;
    end;

    Published by: user9213000 on January 24, 2013 07:38

    Standard when boards (ab) use of EXECUTE IMMEDIATE is to compose the SQL statement in a single VARCHAR2 variable
    Then print the variable before passing to EXECUTE IMMEDIATE.
    COPY the statement & PASTE in sqlplus to validate its correctness.

  • Disk space reduced after deleting and creating SATA data warehouses

    I was experimenting with measurement feature multiple with a host ESXi 5.0 (build 515841), which has two 2 TB SATA drives connected to the motherboard SATA controller. For the test, the first hard drive was installed with a VMFS5 data store and the second disc was added as an additional measure. The ability to store data went up 3.62 to as expected (individual drives show up 1.81 TB in VMware). After the test, I deleted the data store to configure the drives as of separate data warehouses. The second disc correctly displays a 1.81 TB of available space, but the first drive shows only a maximum of 256 GB of available space. The structure of the disc shown before creating the data store on the first hard disk shows 1.81 TB of free space. Additional free space can be recovered without having to reinstall ESXi? Thank you.

    I didn't not experiment a lot with VMFS-5 me yet, but I have had a few discussions with other users. What they say, you can be able to increate the VMFS partition of size (in stages) by using partedUtil, and then run vmkfstools to cultivate the datatore. See for example Re: cannot increase the capacity of VMFS 5.54 data store

    With your layout of the partition, it would be s.th. as these two commands:

    partedUtil resize "/vmfs/devices/disks/vml.01000000002020202020204d4e313232304633304d41553544486974616368" 3 10229760 3907029167
    vmkfstools --growfs "/vmfs/devices/disks/vml.01000000002020202020204d4e313232304633304d41553544486974616368:3" "/vmfs/devices/disks/vml.01000000002020202020204d4e313232304633304d41553544486974616368:3"
    

    André

  • Newbie: deleting and creating a similar user

    Oracle 10g
    HI: I need to remove and recreate the user. That's what I had in my previous notes.

    1. How do I tell me what is the current default tablespace
    2. how to find out the current temporary tablespace?
    3. space table and space temporary table deleted when I drop the user. If so, is it possible some other user's default tablespace, and temporary tablespace is the same as well.
    Drop user systems cascade;
    /
    CREATE USER SYSTEMS
      IDENTIFIED BY VALUES 'Test123'
      DEFAULT TABLESPACE USERS
      TEMPORARY TABLESPACE TEMPts1
      PROFILE DEFAULT
      ACCOUNT UNLOCK;
    /

    When you delete a user space temporary table and default don't get deleted.

    Before you delete a user, the user creation script, give the script like this.

    1. create the user script

    Go head
    set pages 0
    long value 9999999
    Select dbms_metadata.get_ddl ('USER', username) | usercreate ' / ' from dba_users;

    or

    SELECT DBMS_METADATA. GET_DDL ('USER', USERNAME) | ' / ' DDL FROM DBA_USERS;

    2 grant script
    SELECT DBMS_METADATA. GET_GRANTED_DDL ('ROLE_GRANT', 'username') FROM DUAL;
    SELECT DBMS_METADATA. GET_GRANTED_DDL ('SYSTEM_GRANT', 'username') FROM DUAL;
    SELECT DBMS_METADATA. GET_GRANTED_DDL ('OBJECT_GRANT', 'username') FROM DUAL;

  • REF cursor in sql dynamic help to run immediately

    Hello

    How can we get the Ref cursor out a dynamic sql statement by executing immediate proceedings
    for example, immediately run ' open CROR for select * from dynamicTable'

    in this area, CROR is a dynamic cursor and table name is dynamic (known at run time), and we can't write static sql statement.

    Thank you

    I don't know what exactly you are after but here is a sample of what can be done.

    SQL> VAR r REFCURSOR;
    SQL> BEGIN
      2          OPEN :r FOR 'SELECT * FROM DUAL';
      3  END;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> PRINT r
    
    D
    -
    X
    

    You can use the OPEN... FOR education with a dynamic string.

  • DROP table and CREATE with column name and ORA: 00904

    Hello
    I created a table with an attribute date CRTD_ON and two other attributes. Successfully created. I can see the data tab and the window empty data with column names in the header...
    Now, I had to change the name of field attribute date on OPNG_DATE so I don't bother to change, instead, I deleted and created with the name of the column has changed. Then I restart the ddl. Once again managed to create. But this time I am not able to see the data tab or the column headings. And I see the error of the log of the data Publisher ORA-00904: "CRTD_ON": invalid identifier
    Is this a bug?

    There is a current bug where you will get the data if you have a public synonym with the same table name pointing to another table with another structure. Can you confirm that in your environment?

    K.

  • Click right does not work. Profile already deleted and started in safe mode

    I googled and used solutions of mozilla for safe mode, delete and create a new profile (deleted all files) disabled all the plugins. I discovered a problem where clicking on ask to activate does not drop down to select another option. I tried the plugins folder thought I could delete all the plugins and start again. Nothing I've tried has worked at all. I also uninstalled and reinstalled the latest version. I noticed that the version installed is under program (x 86), which is where I thought that 32-bit applications are implemented? Anyway, even by selecting text on a page and right click does not work

    You have a problem of mouse anywhere else?

    The software on your system is up to date?

    Start your computer in safe mode with network. Then launch Firefox.
    Is always the question?

    Start the computer in Mode safe;
    Free online encyclopedia

  • "Create Sequence statement" simple giving ORA 00604,06502 and 00955 while giving only 00955 in another environment

    Hello

    We have two Oracle 11 g R2 databases hosted on the AIX platform and running the same 'create the sequence' gives me different error messages

    Create sequences "IDS_B88E01_SEQ" START BY INCREMENT of 1 BY 1; 


    1 database

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Second time in a row below "create the sequence" statement gives me AN error message

    ORA-00955 - name already used by an object existing.

    Database 2

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Second time in a row below "create the sequence" statement gives me FOUR error messages

    ORA 00604 - an error has occurred at the SQL level recursive 1

    ORA-06502-pl/sql: digital error or value

    ORA 06512 - line 11

    ORA-00955 - name already used by an existing object



    Will there be other parameters in the database that you might be aware that leads to the different exception handling?

    I really need a mechanism which will be generic to the environment of exception handling

    It will be a ddl after initiation... Triggering event will be 'DDL '.

  • Error: [ORA-02289: sequence does not exist.] -

    Hi guys!

    I have a problem when creating a package body.
    The bellows of the sequence is not known, and it is in the PACKAGE BODY:
    SELECT CAMPO_SEQ. CURRVAL IN pNewID FROM DUAL;

    Let me put the script and execution as:

    SQL > CREATE or REPLACE PACKAGE in the CAMPO_PACK
    2
    3 TYPE T_CURSOR IS REF CURSOR;
    4
    5 PROCEDURE InserirCampo (pNewID NUMBER, pCod_Requisicao NUMBER, pCod_Ti
    poCampo NUMBER, pCampo VARCHAR2, pDataInicial TIMESTAMP, TIMESTAMP, p pDataFinal
    Cod_Cidade NUMBER,
    6 pLogradouro VARCHAR2, VARCHAR2, VARCHAR2 pComplemento pNumero, GO pBairro
    RCHAR2, PDCP VARCHAR2, pProtocoloRelacionado VARCHAR2);
    PROCEDURE GetCamposByRequisicaoID (the pCod_Requisicao NUMBER, IO_CURSOR OUT 7
    T_CURSOR);
    8 PROCEDURE DeletarByRequisicaoID (pCod_Requisicao NUMBER);
    9
    10 END CAMPO_PACK;
    11.

    Package created.

    SQL > CREATE or REPLACE PACKAGE BODY CAMPO_PACK as
    2
    3 PROCEDURE InserirCampo (pNewID NUMBER, pCod_Requisicao NUMBER, pCod_Ti
    poCampo NUMBER, pCampo VARCHAR2, pDataInicial TIMESTAMP, TIMESTAMP, p pDataFinal
    Cod_Cidade NUMBER,
    4 pLogradouro VARCHAR2, VARCHAR2, VARCHAR2 pComplemento pNumero, GO pBairro
    RCHAR2, PDCP VARCHAR2, pProtocoloRelacionado VARCHAR2) AS
    5 BEGIN
    6 INSERT INTO Campo (Cod_Requisicao, Cod_TipoCampo, Campo, DataInicial, D
    ataFinal, cod_cidade, number, complement, Bairro, CEP, Logradouro, ProtocoloRel
    acionado)
    7 VALUES
    8 (pCod_Requisicao, pCod_TipoCampo, pCampo, pDataInicial, pDataFinal, BCP
    d_cidade, pLogradouro, pNumero, pComplemento, pBairro, PDCP, pProtocoloRelaciona
    (c);
    9
    * 10 SELECT CAMPO_SEQ. CURRVAL IN pNewID FROM DUAL; *
    END 11 InserirCampo;
    12
    PROCEDURE GetCamposByRequisicaoID (the pCod_Requisicao NUMBER, IO_CURSOR OUT 13
    T_CURSOR)
    14 EAST
    15 V_CURSOR T_CURSOR;
    BEGIN 16
    17 OPEN FOR V_CURSOR
    18 SELECT C, Cam.Cod_TipoCampo, Cam.Cod_Requisicao, Cam.Cod_Campo
    AM. Campo, Cam.DataInicial, Cam.DataFinal, Cid.Cod_Cidade, Cid.NomeCidade, Cid.Co
    d_UF, UF. Description UFDescricao,
    Cam.Logradouro 19, Cam.Numero, Cam.Complemento, Cam.Bairro, Ca
    m.CEP, Cam.ProtocoloRelacionado
    Campo Cam 20
    21 LEFT JOIN Cidade Cid ON Cid.Cod_Cidade = Cam.Cod_Cidade
    A JOIN LEFT 22 UF ON UF. Cod_UF = Cid.Cod_UF
    23 WHERE Cod_Requisicao = pCod_Requisicao;
    24 IO_CURSOR: = V_CURSOR;
    25 END GetCamposByRequisicaoID;
    26
    27 PROCEDURE DeletarByRequisicaoID (pCod_Requisicao NUMBER) HAVE
    BEGIN 28
    29 DELETE FROM campo
    30 WHERE cod_requisicao = pcod_requisicao;
    ENDS 31 DeletarByRequisicaoID;
    32
    END 33 CAMPO_PACK;
    34.

    Warning: Package body created with compilation errors.

    SQL > show err
    Erros para PACKAGE BODY CAMPO_PACK:

    LINE/COL ERROR
    -----------------------------------------------------------------
    10/5 PL/SQL: statement ignored
    10/12 PL/SQL: ORA-02289: sequence does not exist.
    SQL >

    What must I do to solve this problem?
    Thanks for the help!

    Anderson

    If there is no selected line then don't create the sequence by giving this command
    create sequences CAMPO_SEQ begins with 1 increment of 1;

    Arpit sinha
    www.OracleDBA.in

  • Scripts customized transformations: creating sequences and synonyms

    Is there a way to Data Modeler to describe the process of creating sequences and synonyms. I have already found how to create columns in a table, but it is also possible to create sequences and synonyms for tables? I watched it in the XML metadata, but I have not found where I was looking for? Can someone help me?

    Support more will be included as part of the XML meta data in the next version.

    Philippe

Maybe you are looking for