Publish in the sequence of creation

Hi all

I use
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
I have the diagram with the following roles
ALTER ANY OUTLINE
CREATE ANY OUTLINE
CREATE ANY SYNONYM
CREATE DATABASE LINK
CREATE MATERIALIZED VIEW
CREATE PUBLIC DATABASE LINK
CREATE VIEW
DROP ANY OUTLINE
DROP PUBLIC DATABASE LINK
SELECT ANY TABLE
UNLIMITED TABLESPACE
CONNECT
DBA
EXP_FULL_DATABASE
IMP_FULL_DATABASE
OEM_MONITOR
RESOURCE
I can create a sequence by SQLPLUS and toad.
SQL> CREATE SEQUENCE ROLE_ACTIVITY_SEQ START WITH 225006249 INCREMENT BY 1 MAXVALUE 9999999999999999999 MINVALUE 225006249 NOCYCLE CACHE 100 ORDER;

Sequence created.

SQL>
When I try to create the sequence in a dynamic way through get error in PL/SQL procedure
SQL> execute PROC_CLONE_BU;
BEGIN PROC_CLONE_BU; END;

*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SUPERNOVA.PROC_CLONE_BU", line 19
ORA-06512: at line 1


SQL>
Even though I have the DBA role for the schema. I do not know what oracle of privileges always the exception...

Pls guide me to solve...

Thanks and greetings
Saami

Procedures PL/SQL etc (except anonymous PL/SQL) does not take into account the roles.
You must grant permission to create sequences explicitly to the user who will perform the procedure.

You can also get the procedure to use a particular role, but you end up switching dynamically from the roles in your code and things can get messy. If a user is supposed to be able to do something, it's much cleaner (IMHO) to give explicit permission to the user that something.

You should also question yourself as to why you are trying to create a sequence dynamically to the execution of your code? What is the purpose of the present, and why the sequence cannot be created as part of database design?

Tags: Database

Similar Questions

  • Creation of the sequence in DB

    I want to store the id of the collection in a column of the table through a sequence

    The sequence must begin with CL00001, CL00002, etc.

    Can write us a sequence in which they also include the alphabet

    Or you can use it.

    select 'CL'||to_char(SEQ_TEST.NEXTVAL,'FM00000') from dual;
    

    The difference with the Nicloeis code is the exit for values greater than 10.

    CM00010
    CM00011
    ...

    But wouldl get you into trouble with values greater than 99999. The output would then always be

    CM #.

    Published by: hm on 29.06.2011 23:09

  • Creation of settings of variables / a module of code that persist when the sequence is complete

    I create parameters/variables programmatically in a module of code (c#) by passing the object to people of the country and calls the "NewSubProperty".

    I also tried SetValNumber with PropOption_InsertIfMissing.

    But it seems that they are only created in this instance of the sequence, because they left when the sequence is over. I really wanted to persist.

    I wanted to avoid creating the globals station dynamically like that, but maybe that's all I can do to make them last.

    Any ideas would be appreciated gratefully.

    Thank you

    Ronnie

    Hello

    Check out the links on this answer

    http://forums.NI.com/NI/board/message?board.ID=330&message.ID=11226&query.ID=267719#M11226

    It may be useful

    Concerning

    Ray Farmer

  • Executes the sequence by programming

    Hello

    I see a problem by running the file in sequence by programming. I mentioned the example VI (C:\Users\Public\Documents\National Instruments\TestStand 2014 (32 bit) \Examples\TestStand API\Executing API\LabVIEW using sequences) comes with TS2014 which crosses the sequence context of sequence by invoking TSEngine so the entries to the VI are sequence context, movie file, the process template.

    To facilitate my task, I modified the code attached to make autonomous running the sequence through TSEngine directly to entries in VI are movie file and the model of process.

    It works fine when I run like VI, but does not work during the conversion into exe.

    Please let me know if I'm something wrong or missed something

    Thanks in advance

    -Vivek

    You should look into the creation of a user interface you want to execute your order by programming. The user interface can be hidden if it works the same as your code is planned. Start with the simple graphic interface "C:\Program Files (x 86) \National 2014\UserInterfaces\Simple\LabVIEW" so see how this can be done.

    More precisely. a person does not open a reference to the engine. What is much more common is a person placing the Application Manager control, call the Start method. and then get the reference to the engine here. Be sure to stop the application subsequently and additional references nearby. I guess because you're in a development environment is the reason that your code works like a VI.

  • Popup message when the charge of the sequence

    Total newbie to TestStand, first post

    I noticed that the Bill to open some of the example TestStand sequences will cause a pop-up message displays describing what is talking about the example. I am trying to understand the source of this message. It is not in the sequence steps.

    Thank you!

    Welcome to the forums, Jim,

    It will be displayed in a callback.  When you have the sequence example open, you will notice that there are a few sequences in the part of the sequence that are a different color (purple kind).  You add the reminder that your sequence and edit similarly to the way the example was published.

    GSinMN

  • Display dialog popup to step to the sequence type

    I have a type of step in LabVIEW with module parameters and variables of the step which must be installed to configure this step. Can I do to display the dialog box pop-up to enter the required values for the time when I drop the step to a new sequence type?

    Examples: 1. I have variable TestID of steps which must be installed. Pop-up dialog box is more convenient that is variable and by searching the TestID in the tree.

    2. I have one type of step that makes different actions depending on the parameter enum in the LabVIEW module. This is set by default in steptype. I would like the name of the step in my sequence to match the value of the enumeration. Something like RunState.Step.TS.SData.ViCall.Parms ["Update Configuration"]. ArgVal in step step Expression name by default type help and displays the text of the enum as a stage name, when I drop the type of step of the sequence. But change the Configuration parameter update during this step to another value is not followed by changing the name of the step, looks like step default step name the type Expression is evaluated once what stage is created from the step type.

    Yes, you can add code to your step type that is called whenever an instance of it is inserted into a sequence. Create a customized type of step step and name it OnNewStep. TestStand will then call this substep whenever a new instance of the step type is inserted into a sequence.

    The default expression is evaluated only when the step is inserted, that is correct. I don't know in a way that you could make the name of the step automatically updated based on the value of the parameter of the module planned for it. You could write some kind of tool that updates the names of these steps in a sequence and run that, periodically, but I don't think there's a way to have your code directly from a user action to specify a code module. You can create your own user interface to specify things on the steps by using a publishing step and this edit substep could update the name, but I'm not sure this is a practical solution for your particular use case.

    Hope this helps,

    -Doug

  • Comps AE in Premiere Pro CC import 2015, cannot be added to the sequence.

    I tried to import a former After Effects composition into Premiere Pro 2015.4 CC (10.4.0 (30) build on Windows 10), but I am running into a problem:

    All my compositions are important with no error message and I can preview, but I can't drag them on the sequence as anything else audio (which is empty, because they have Visual effects only).

    The result is the same if I import them through to dynamic links or the importer of standard creation. Things like start little put me behind my work (as I browse these forums and get NO HELP from ADOBE while trying to understand these problems). It's funny, because I have the exact opposite problem with old creating sequences that will matter without errors and drop all the audio exactly WITHOUT reason.

    Correction of the source in Premiere Pro sequences

  • insertion of unique values as well as the value of the sequence

    Hello gurus,

    I need to copy values from table A to table B as well as the value of the sequence.

    Please find the scripts below.

    -Table A and insert

    create a (varchar2 (40) of ename, space job_id varchar2 (40));

    insert into a values ('Suri', 'THIS');

    insert into a values ('Suri', 'THIS');

    insert into a values ('ABC', 'Admin');

    -Creation of table B

    create table B (number empno, ename varchar2 (40), job_id varchar2 (40));

    -sequence to fill data in table B empno

    create sequences b_empno_seq.

    Requirement is that we need fill out the unique values in table A in table B as well as the sequence (for the empno column) value

    Please find below the insert and update statements I tried below.

    Please let me know if we have a better approach

    INSERT INTO B (ename, job_id)

    SELECT DISTINCT ename, job_id

    A.;

    UPDATE b b1

    SET empno = b_empno_seq. NEXTVAL

    WHERE ename in (SELECT ename b B2 WHERE b2.ename = b1.ename);

    -Suri ;-)

    INSERT INTO B

    () AS T

    SELECT DISTINCT ename,

    job_id

    A

    )

    SELECT b_empno_seq.nextval,

    Ename,

    job_id

    T

    /

    SY.

  • That need GG to reproduce the sequence

    Hi all

    We have sequences that create values used for the primary key. We are on the process of creation of replication between Oracle databases.

    I was going through the documentation, it contains some steps which is mainly for the initial loading of data. (Installation of Support for Oracle in Oracle Installation and Configuration Guide 12.1.2 sequences)

    My question is that I have to follow these steps for change also online synchronization? Or we can jump?

    Thank you

    Basu

    Hi Ben,

    Oracle GoldenGate supports replication of the Oracle sequences. But we must be aware of some issues, replication of sequences are supported by.

    1. change Data Capture (CDC) - synchronization of change online.

    2. the batch where the control points are not maintained.

    But it is not supported for the bottom.,.

    1. the first charges.

    2. When you configure two-way replication (bidirectional).

    That's why in the Oracle documentation, it was referred to as.,

    To support Oracle sequences, you must install some procedures database.

    These procedures supports the command FLUSH SEQUENCE of Oracle GoldenGate

    which issue you immediately after you start the Oracle GoldenGate dealt for the first time

    (usually when you perform the initial data synchronization process).

    Kind regards

    Veera

  • MERGE statement is increment the sequence. It problem?


    Hi all

    I use a merge statement to update thousands of data in a table. If the criteria does not match (WHEN NOT MATCHED) I wrote an insert statement that contains a reference to the sequence. And it works very well.

    My question is, will this increment also sequence even though it won't insert the statement in the script of fusion. I think it will be. Right?

    Say, I update 20K record will be the sequence also increment by 20 times k. If his past all work around.

    Thanks in advance.

    Here is a less effective solution to your problem that creates a function to get the value of the following sequence, but I agree with Justin cave that because of the cache you must lose the values.

    SQL > CREATE SEQUENCE s_emp;

    Order of creation.

    SQL > CREATE or REPLACE FUNCTION s_emp_nextval

    2 RETURN NUMBER

    3 AS

    4 v_nextval NUMBER;

    5 BEGIN

    6. SELECT s_emp.nextval

    7 INTO v_nextval

    8 DOUBLE;

    9 v_nextval of RETURN;

    10 END;

    11.

    The function is created.

    SQL > MERGE IN emp t (USING)

    2. SELECT empno, ename

    3 FROM emp) s

    4. WE (t.empno = s.empno)

    5. WHEN MATCHED THEN

    UPDATE 6

    7 SET t.ename = s.ename

    8 WHEN NOT MATCHED THEN

    9 INSERT (empno, ename)

    10 VALUES (s_emp_nextval, 'SMITH');

    14 lines merged.

    SQL > SELECT s_emp. NEXTVAL

    2 FROM dual;

    NEXTVAL

    ----------

    1

  • Insert data. Select the sequence ID, but popuate even value for two different columns

    Hello

    Version Oracle 11 G

    [code]

    CREATE TABLE MT_PROGRAM

    (

    NUMBER OF "PROGRAM_ID."

    NUMBER OF "REPORTING_PROGRAM_ID."

    'PROGRAM_NAME' VARCHAR2 (128 BYTE)

    );

    INSERT INTO MT_PROGRAM)

    PROGRAM_ID,

    REPORTING_PROGRAM_ID,

    PROGRAM NAME)

    SELECT PROGRAM_ID,

    PROGRAM_ID,

    PROGRAM NAME

    Of

    (SELECT

    fn_get_new_prog_id()

    AS PROGRAM_ID,

    'Test' as the program name OF THE DOUBLE);

    The function has

    create or replace

    FUNCTION "FN_GET_NEW_PROG_ID".

    RETURN NUMBER

    AS

    BEGIN

    RETURN SQ_PROG_ID. NEXTVAL;

    END;

    [/ code]

    Problem is that I must get

    I need Reporting same Program ID ID program and the same sequence. But here I am ecstasy. For example, if my sequence is from 1 then it inserts

    1, 2, 'test '.

    But I need

    1, 1, 'test '.

    P.S. I can't not 1 insert unwanted accounting value of the program and of the update the program id. I have a trigger on the table which keeps track of each insert, update. And I don't want to use the separate update statement because it will create additional row in the history table.

    SQL > create the sequence Tessai minvalue maxvalue 1 99999999999999999 with increment of 1 by 1 cover 2;

    Order of creation

    SQL > select ttest.currval from double;

    Select double ttest.currval

    ORA-08002: sequence TESSAI. CURRVAL is not yet defined in this session

    SQL > select ttest.nextval from double;

    NEXTVAL

    ----------

    1

    SQL > select ttest.currval from double;

    CURRVAL

    ----------

    1

    SQL > select ttest.nextval from double;

    NEXTVAL

    ----------

    2

    SQL > select ttest.currval from double;

    CURRVAL

    ----------

    2

    SQL >

    I have it?

    ----

    Ramin Hashimzade

  • Best practices for the text which changes during the sequence?

    I've been using videos creation as the here, in which text appears from time to time on the scene:

    Making Pinball Machine death market - YouTube

    So far, I have created a title he duplicate for every time the text changes, and loading of each title in the sequence at the point where I want it to appear. Is there a simpler way to create text that changes throughout a sequence, so I don't have to worry about each overlay having slight differences of position or other attributes?

    Just curious to know if there is a workflow easier to place the text on the video.

    Thank you!

    You can also save a few steps by duplicating the title thanks to the timeline by ALT + drag to the new location (which created not only a new element of the track, but also a new independent project item), then double-clicking the new element of the track to open it in the Titler for editing. But this refinement in your workflow has no impact on the concern said re: 'differences of position or other attributes' - it's entirely a function of the changes that you make in the Titler.

  • use the sequence grouping conditional Dynamics

    Hi experts,

    I have a simple task (?) - I want number (assign) groups (increase the number of Group) based on a condition.

    Here is an example: create groups numbered according to the number of Department (as per the same collection)
    create table emp as
    select * from scott.emp;
    
    CREATE SEQUENCE group_no;
    SELECT group_no.NEXTVAL FROM DUAL;
    SELECT group_no.CURRVAL FROM DUAL;
    
    /* automatic grouping - NOT WORKING!!!! */ 
      select ename, deptno, deptno_next, deptno_prev, 
       case when (deptno_next > deptno) then group_no.nextval else 1 end grp 
        from
          (select ename, deptno,
                  lead(deptno) over (order by deptno) deptno_next,
                  lag(deptno) over (order by deptno) deptno_prev
          from emp
          );
    PROBLEM:
    It seems that the sequence is increased, even when the condition for a new number is not satisfied!
    NAME      DEPTNO                 DEPTNO_NEXT            DEPTNO_PREV            GRP                    
    ---------- ---------------------- ---------------------- ---------------------- ---------------------- 
    CLARK      10                     10                                            1                      
    KING       10                     10                     10                     1                      
    MILLER     10                     20                     10                     130                    
    JONES      20                     20                     10                     1                      
    FORD       20                     20                     20                     1                      
    ADAMS      20                     20                     20                     1                      
    SMITH      20                     20                     20                     1                      
    SCOTT      20                     30                     20                     135                   
    WARD       30                     30                     20                     1                      
    TURNER     30                     30                     30                     1                      
    ALLEN      30                     30                     30                     1                      
    JAMES      30                     30                     30                     1                      
    BLAKE      30                     30                     30                     1                      
    MARTIN     30                                            30                     1
    Instead of
    else 1
    I use group_no.currval (same group number, when does not change do not Department). I know, I need to cover the previous number as well, but I did simple, because the problem here seems to be the sequence...

    Forward your support :-)
    Duik

    Published by: user10939560 on 08.10.2012 07:42

    Published by: user10939560 on 08.10.2012 07:44

    Published by: user10939560 on 08.10.2012 07:45

    Published by: user10939560 on 08.10.2012 07:48

    Published by: user10939560 on 08.10.2012 07:49

    "I want number (assign) groups (increase the number of Group) based on a condition."

    But he did exactly want you want. The number of groups is increasing. It is not contiguous, which
    You can not guarantee for sequences of anyway.

    However, if I understand you correctly, it's maybe you need:

          select ename,deptno,
          dense_rank() over (order by deptno) grp
          from emp;
    

    If this isn't the case, please explain in more detail what you are trying to do.

    Published by: Paul Horth on October 8, 2012 08:06

  • Dynamic, create the sequence then select nextval within a transaction

    The following procedure does not compile if the sequence SEQ_ADR does not exist before compilation. I had to manually create the sequence before you can compile this procedure. How can I avoid this manual generation?
    PROCEDURE A_270(proc_id number) IS
    seq_cnt number;
    curr_max number;
    BEGIN
    select count(*) into seq_cnt from user_sequences where sequence_name='SEQ_ADR';
    if seq_cnt > 0 then
    execute immediate 'drop sequence SEQ_ADR';
    end if;
    select max(id)+1 into curr_max from adress;
    execute immediate 'create sequence SEQ_ADR start with '||curr_max||'';
    insert into adress(ID,
    IMPORTED_DT
    )
    select
    SEQ_ADR.nextval ID,
    sysdate IMPORTED_DT
    from new_adress;
    END;
    Published by: totalnewby on August 23, 2012 06:41

    The SELECTION against the sequence should be dynamic as well. Otherwise, the procedure has a dependency on a non-existent sequence.

  • Insert/update of the XML help merge and to generate the sequence number

    Hello

    I'm working on Oracle 11 g.

    I have a doubt with loading XML.
    I get an xml and I need to insert or update data in a table. What I can accomplish by using the MERGE statement.
    But there is a column in A table, I need to fill with a sequence number, based on the data sent in the xml file.
    The XML does not send the data in this column.
    And I have to make sure that sequence is created according to the order in which the records are present in xml.
    For example the MERGER is insert five rows and update two lines and insert again 3 rows of xml in table A. The sequence number must be created in the same order for the column in the table.
    Also for every new XML, the sequence starts with 1 and ends with the number of records in the xml file. I can't create a sequence and use the seq.nextval.

    Please let me know, there is a way to achieve this.

    Thank you!

    Published by: 934451 on 8 August 2012 06:33

    Published by: 934451 on 8 August 2012 06:50

    Hello

    As a result of your previous thread: {: identifier of the thread = 2403469}

    You can use the clause for ORDINALITE in XMLTable to generate the necessary sequence:

    MERGE INTO target_table t
    USING (
      SELECT x.seq_num, x.pk_id, x.col1, x.col2, ...
      FROM XMLTable(
             '/root/record'
             passing my_xml_doc
             columns seq_num FOR ORDINALITY
                   , pk_id   number       path 'ID'
                   , col1    varchar2(30) path 'COL1'
                   , col2    varchar2(30) path 'COL2'
                   , ...
           ) x
    ) src
    ON ( t.pk_id = src.pk_id )
    WHEN MATCHED THEN UPDATE
     SET t.seq_num = src.seq_num
       , t.col1 = src.col1
       , t.col2 = src.col2
       , ...
    WHEN NOT MATCHED THEN INSERT
     (seq_num, pk_id, col1, col2, ...)
     VALUES (src.seq_num, src.pk_id, src.col1, src.col2, ...)
    ;
    

Maybe you are looking for

  • some incoming e-mail messages shows souce Code. How can I change this? (I am a novice)

    ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > "" < title > your e-Bill is ready < /title >< content meta = text/html"; charset = iso-8859-1 "http-equiv ="Content-Type">"<

  • Data transfer?

    Is to connect your iPad to a computer to transfer data to your iPad another way of data transfer such as an OTG device as a micro SD card? Thank you

  • Native SSH and SFTP in LabVIEW

    At the risk of re-opening a Pandora's box, there is no consideration to add native SSH and SFTP support for LabVIEW? Using PuTTY/plink is heavy and not multiplatform. Calling a .NET (or other) an external assembly is heavy and not multiplatform. Labw

  • Cannot install windows update, error: 663

    Original title: Error 663 I'm trying to update my computer but am getting error failure 663 this need to I do?

  • SP 1 or SP 2

    do I need to install the two SP 1 and SP 2 or can I just install SP 2