I am trying to create a sequence to be use as primary key in a Oracle table

Hi guys
I have the ODI version 10.3.5 and I am trying to create a sequence that populates de row_id for a table. The schema is a database.
And I want that this item will be the primary key of the table that is loaded at execute the interface however I'm getting issues.
So please advise me.

Hi ,
Can you please provide the following details :
1. What is the execution area of your sequence ? Is it source or staging or Target.
2. What IKM you are using ( I hope you are executing sequence in Staging or Target ) ?
My understanding is when you check Not Null , all your rows are going to Error table. So it is not giving any error.
When you uncheck the Not Null , it is giving error because Database is not allowing Null values in the Primary Key Column.
You can do the following to check if your sequence is working properly.
Try to write a Insert Select query in DB and execute it and see if it is working properly.
i.e.
insert into      EMPL     (
     EMPNO,
     ENAME,
     JOB,
     MGR,
     HIREDATE,
     SAL,
     COMM,
     DEPTNO
select      S_EMPNO.NEXTVAL,
     ENAME,
     JOB,
     MGR,
     HIREDATE,
     SAL,
     COMM,
     DEPTNO
from     EMP
or if you can provide your query in this format , it will help in finding the issue quickly.Also provide the KM details.

Similar Messages

  • Creating a row trigger to populate the primary key

    to populate the primary key of a table automatically, i created a sequence named rule_id
    using the following statement:
    create sequence rule_id;
    and then i created a trigger to populate the primary key using the statements below:
    CREATE OR REPLACE
    TRIGGER RULE_ID BEFORE INSERT ON DOC_CATS_RULE_BASED_CLASS
    FOR EACH ROW
    BEGIN
    SELECT SEQ_RULE_BASED_CLASS.NEXTVAL
    INTO :new.id FROM DUAL;
    END;
    i took this from a books example. but it gives and error called:
    Error(3,8): PLS-00049: bad bind variable 'NEW.ID'
    What is wrong and what is the current way to do it?
    Please help!

    Hi ,
    The new denotes the new data values for the table relative column.....
    As regards the dual is a small table in the data dictionary that Oracle and user-written programs can reference to guarantee a known result. This table has one column called DUMMY and one row containing the value X.
    Regards,
    Simon

  • How can I use the SQL to create a primary key for a existing table?

    create table a(bm number,mc varchar2(20));
    when the table was created,i want to make the column bm as
    the primary key and my SQL is "alter table a enable primary key bm",the system show
    me error,how can I write the right one?

    create table a(bm number,mc varchar2(20));
    when the table was created,i want to make the column bm as
    the primary key and my SQL is "alter table a enable primary key bm",the system show
    me error,how can I write the right one? You do not have any primary key defined on your table yet, so, it does not make sense to enable it (if at all possible) !
    You need to add PRIMARY KEY using something like this:
    SQL> alter table a add constraint pk_a_bm primary key (bm) ;

  • Use multiple primary keys to create DB constraint

    Hi,
    Is it possible to have multiple primary keys within one EJB to create a DB including the constraints, if so how? Is there an example of this or any example which uses multiple primary keys to create a DB?
    Thanks,
    Maarten

    "Is it possible to have multiple primary keys within one EJB..."
    If you mean a composite key, yes. Your PrimaryKeyObject would have one attribute for each column that makes up your composite key. If that's not what you meant, please clarify.
    "...to create a DB including the constraints"
    Not sure what you mean here. Constraints are enforced by the DB, and you don't create databases with EntityBeans.

  • Trying to create multiple sequence window

    I'm new to swing, and I have a project in which I need to create multiple sequence frame swing program.
    To give you a better idea, I'm trying to create something that's similar to a self checkout shopping cart expect there is a frame where I need users to login. I already have a MySQL database setup for that.
    Once the user passes the login frame, I need another frame that will show up to displace information, and multiple other frames to come and go.
    I learn really well by examples, so are there any place I can find example of this. Thank you

    What I need is a transition between different layout. I need a layout say a login layout to finish (run successfully) and it transition to a different layout.
    I looked through the totorials and didn't see anything about transitions.
    I don't need need something like a desktop with multiple frames being displated at the same time. I need a sequence of frames
    Ah never mind.. cardmanager is what I need
    Message was edited by:
    d1sturbanc3

  • Trying to create a sequence, from 3 fields

    I need to come up with a mechanism to generate the primary key for a table.
    the table looks something like
    Co | Permit | Episode | a | b | c | Co2 | Permit2
    the co2 and permit2 are foreign keys to another table. Co and Permit are just copies of Co2 and Permit2. So then I am adding another field "Episode" to create the primary key.
    so I would have something like
    1-00001-1 a b c 1-00001
    1-00001-2 a b c 1-00001
    1-00002-1 a b c 1-00002
    1-00002-2 a b c 1-00002
    1-00002-3 a b c 1-00002
    1-00003-1 a b c 1-00003
    I wanted to use a seq to generate this, but since it is multiple fields it is not a continues number where a 1 or multiple needs added on. Do I use a sequence here? Trigger?
    Any suggestions?

    John,
    I am not necessarily saying that this is the way to go, but am just providing you with what you originally asked for, as an option to consider. The following trigger would insert numbers into the episode column in the manner that you specified:
    CREATE OR REPLACE TRIGGER episode_trigger
    BEFORE INSERT ON table_name
    FOR EACH ROW
    BEGIN
    SELECT MAX (temp_max)
    INTO :NEW.episode
    FROM (SELECT 1 temp_max
    FROM DUAL
    UNION
    SELECT MAX (episode) + 1 temp_max
    FROM table_name
    WHERE co = :NEW.co
    AND permit = :NEW.permit);
    END episode_trigger;
    null

  • Trying to create DLL from VI to use in TestStand.

    I trying to create a DLL out of an existing VI file.  The VI has about 4 inputs and about 3 outputs.  If I go to Tools >> Build Application and select the Build Target as a "Shared Library (DLL)" i get a dll after the build; but when I try to call that DLL from teststand, it doesn't recognize any of the inputs or outputs.  How do I build a DLL so that teststand will reconize the inputs and outputs?
    Solved!
    Go to Solution.

    The controls and indicators are connected to the connectors.  Also, answering an earlier post, the prototype information for the inputs and outputs are not automatically displayed. I can manually define the prototypes, but then the question is how does each prototype link to its corresponding parameter (by name?). I've also tied creating just a simple VI that has just one string input and one string output.  I built the VI to a DLL and tried calling in TestStand and i get the same results.  I've inserted the resulting header file after that build.  Which, by the way, looks exactly like my other created DLL's header file.  The difference in bold(the name of the VI). Which makes me thik that my build DLL process might be off.
    #include "extcode.h"
    #pragma pack(push)
    #pragma pack(1)
    #ifdef __cplusplus
    extern "C" {
    #endif
    void __stdcall String_input_output(void);
    long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);
    #ifdef __cplusplus
    } // extern "C"
    #endif
    #pragma pack(pop) 

  • Having a problem with creating/using a primary key on a view

    I have a problem with a primary key on a view
    I created the view and primary key as follows:
    CREATE OR REPLACE FORCE VIEW "MDD"."ROCK_LU" ("DESCRIPTION",
         UNIQUE ("DESCRIPTION") RELY DISABLE,
         CONSTRAINT "ROCK_LU_PK" PRIMARY KEY ("DESCRIPTION") RELY DISABLE) AS
    SELECT DESCRIPTION
    FROM MRMC_LU
    WHERE ROCK = 'T';
    The view with the primary key appears to have been created as there were no error messages. (The above was from the sql tab in sql developer.)
    When I try to create the foreign key on my mdd_hr table - I get an error
    /* hr_name - foreign key */
    ALTER TABLE mdd_hr add CONSTRAINT hr_name_fk FOREIGN KEY (hr_name) REFERENCES rock_lu(description);
    Error report:
    SQL Error: ORA-02270: no matching unique or primary key for this column-list.
    When I lookup the index in sql developer, rock_lu_pk is not there.
    All my other foreign keys work - but I don't understand what I am doing wrong with this one. Please help.
    glenn
    Background - as to why I want to use a view as a lookup table.
    The MRMC_LU table that the view is created from is structured like:
    DESCRIPTION - MINERAL - ROCK - MODIFIER - COMMODITY
    ANHYDRITE - T - T - T
    APLITE - T - - T
    GRAPHITE - T - - - T
    GREYWACKE - - T
    DESCRIPTION is a list of all names of minerals, rocks, modifiers and commodities. T is entered in each valid field. Often a description name is used for both a mineral and a rock or a mineral and a commodity or any other combination. Because this database is just starting up, it was more efficient to create one table that could be updated (and thereby automatically update the MINERAL_LU, ROCK_LU, MODIFIER_LY, COMMODITY_LU views) rather than create and maintain four separate but similar tables. A primary key cannot be generated for the MRMC_LU table as there are nulls in each column
    except DESCRIPTION.
    Perhaps there is a smarter way to do this?

    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_85a.htm#2065512
    You can specify constraints on views and object views. You define the constraint at the view level using the out_of_line_constraint clause. You define the constraint as part of column or attribute specification using the inline_constraint clause after the appropriate alias.
    Oracle does not enforce view constraints. However, operations on views are subject to the integrity constraints defined on the underlying base tables. This means that you can enforce constraints on views through constraints on base tables.
    Restrictions on View Constraints
    View constraints are a subset of table constraints and are subject to the following restrictions:
    You can specify only unique, primary key, and foreign key constraints on views. However, you can define the view using the WITH CHECK OPTION clause, which is equivalent to specifying a check constraint for the view.
    Because view constraints are not enforced directly, you cannot specify INITIALLY DEFERRED or DEFERRABLE.
    View constraints are supported only in DISABLE NOVALIDATE mode. You must specify the keywords DISABLE NOVALIDATE when you declare the view constraint, and you cannot specify any other mode.
    You cannot specify the using_index_clause, the exceptions_clause clause, or the ON DELETE clause of the references_clause.
    You cannot define view constraints on attributes of an object column.
    Rgds.

  • I am trying to create a pop up page, using iweb 08

    I want to create a custom size pop up page using iweb08, using a html generator, I created the html code, I plugged it in using the html snippet widget. But its not working. Do you know what I am doing wrong?
    I love the look of http://jquery.com/demo/thickbox/ but I really don't understand the instructions, and if I did would it work with iweb?
    I have to say, I am pregnant, and my brain isn't working as well as it usually does. So please think of me as a not very intelligent person when you are explaining how to create the pop up.
    Bless u for your help.
    www.sarahyoga.com

    You may want to consider Lytebox: http://www.dolem.com/lytebox it's much lighter than jquery & thickbox.
    You can see example here: http://web.mac.com/mhartinger/mark-andrewhartinger.com/Home.html
    Mark has all the code in his page's html snippets.
    I have integrated Lytebox into iWeb, but it involves with quite a bit of coding; I'm planning on writing an app to automatically generate all needed the code.

  • Trying to create a latching push button using digital inputs

    Hi everyone,
    I'm writing a program to control a motor with 3 push buttons, Up, Down and Stop. I want the Up button to latch when pushed and delatch when Stop or Down are pushed. I've tried the Resettable Latch.vi example program from this website but no luck. It seems like the output  from the AND gate is indeterminate. I've attached my program, Any help would be great! Thanks
    Solved!
    Go to Solution.
    Attachments:
    LatchAttempt.vi ‏140 KB

    Use Index Array to get the single boolean you want from the array.  If you don't wire an index it will give you element 0.  Using this you could have all the switches wired to different pins of the same register on your DAQ device.  Then you could read one byte and sort out which bit does what.  You also need to build the individuale booleans into an array before writing to the DAQ.  Here's a quick example:
    You need to decide which button sets which bit.  I haven't checked the logic of your latch algorithm yet.
    Kelly Bersch
    Certified LabVIEW Developer
    Kudos are always welcome

  • I am trying to create new webi report by using Infoview (BO3.1) I am getting error?

    Plz check the screen shot
    Help on this

    HI Riaz Ahmed,
    Please check the note 1717315, if its relevant for you.
    Issue seems to be with your browser.
    BR
    Prabhith

  • JDeveloper 10g Creating a new record with trigger sequence primary key

    Hi there, I'm sorry to post this incredibly simple question and I'm sure that someone must have answered this on this forum before but the searching of this site is incredible slow and painful and after 30 mins I can't find help.
    I am using a struts Data Action to create a new record in the database and then being forwarded to an edit page where I can enter the new details. Then when the details are entered I am clicking an update button and returning to a browse screen where I can either commit the change to the database or rollback. Sounds pretty simple but I am really struggling with trying to get the trigger of the number sequence to work properly.
    Ideally I would like to click the create new record button and then the primary key/triggered sequence number is already displayed on the empty form...
    ... but if this is too tricky or not possible then I would like the user to either not enter any value in the key field (which currently causes error - JBO-27014: Attribute PoNo in PO_SYS_MODULE.PoSystemView1 is required) OR the user enters a number and the trigger overwrites this number with the next in the sequence.
    I can enter a new record if I look in the manager console and see the next number in the sequence and then create the record using this number and then click commit twice, as the first time I get the error: JBO-25019: Entity row of key oracle.jbo.Key[154 ] not found in PoSystem. Or if I enter a value 5 times greater than the next in the sequence I have to click the commit button 5 extra times to get the sequence to match the input.
    I hope that this lengthy explanation fills you in on my problem, there must be a simple solution to this and I will be VERY grateful to anyone who can help me.
    Many thanks
    Ben Sayers (clearly a newbie)

    Hi,
    ADF Business Components handles this for you - unless yo prefer doing this manually. In the Entity Object, set the PK attribute's type to DBSequence. Then create a database sequence and use a database trigger to add the sequence value on insert
    Frank

  • How to create a sequence in Answers?

    Hi everyone,
    I want to know if it's possible to create a sequence in Answers and how.
    I have a Pivot table that I want to assign row numbers, but when I use RCOUNT(1) in a Dummy column I end up with 1 in all rows.
    This is the format of my pivot table.
    -------------------------------------Measure---
    ---------------------------------Y-1-------Y----
    Order(DUMMY)---Code---Desc-- 2009 ----- 2010
    1 435 idn 1 2
    1 53 dvf 3 1
    1 123 asd 8 4
    I've tried to do RCOUNT(1 by Y) but then I end up having the double of rows.
    Can it be done???
    Thanks in Advanced

    Try doing this:
    1) Create a dummy column and call it DUMMY with this in the fx:
    CASE WHEN 1=0 THEN tablename.columname ELSE 'whatever' END
    2) You can hide this column.
    3) Then in your "sequence" column, click on the fx and type:
    RCOUNT(1 by DUMMY)
    where "DUMMY" is the column created in step 1.

  • Trying to create a simple example. Need Help!

    I'm trying to create a very simlpe examlpe using Swing components to illustrate a MVC architecture.
    I have a JFrame containing a JTree and a JButton.
    What I'd like to happen is when I click the JButton the JTree model is changed in some fashion and the the view is refreshed due to the models change.
    If anyone out there has a simple example of any MVC architecture involving Swing components I'd love to see it.
    Thx

    Sure, look at any of the Sun tutorials. For example, look in your API documentation for JTree; it has a link to a tutorial about how to use JTree.

  • SQL Data Modeler 3.0 EA1 trying to create primary key on OT

    Hi,
    I'm trying to modify a primary key of an object table that was reversed (imported) from an Oracle 11.2.x RDBMS and am getting the error message "Incomplete Index definition". It is showing in the window "Index Columns Assignment". I get to the 'Primary Key Properties' window by pressing the 'Properties' button on the 'Table Properties' -> 'Primary Key'. If I try to edit the expression and then press the Ok or Apply buttons I get the error. With this be fixed in the production version? Will we be able to create a model in SQL Developer Data Modeler that generates a SQL statement similar to the following:
    ALTER TABLE x_flags
    ADD (CONSTRAINT x_flags_pk PRIMARY KEY (flags.id))
    Thanks,
    Scott K

    Hi Scott,
    I'm trying to modify a primary key of an object table that was reversed (imported) from an Oracle 11.2.x RDBMS and am getting the error message "Incomplete Index definition"... With this be fixed in the production version?yes
    Will we be able to create a model in SQL Developer Data Modeler that generates a SQL statement similar to the following:
    ALTER TABLE x_flags
    ADD (CONSTRAINT x_flags_pk PRIMARY KEY (flags.id))I assume "flags" is column of object type and "id" is attribute of that type. I logged bug for that, so there will be support however not for 3.0.
    Philip

Maybe you are looking for

  • Stuck on grey screen with apple logo when starting up?

    Hi, My Macbook (2009 aluminium unibody (Leopard 10.5.8)) won't boot. When I try to start it up it gives the chime and then gets stuck at the grey screen with the Apple logo and some spinning gear below. I have tried booting with the install DVD and r

  • Class not registered (Exception from HRESULT: 0x80040154 ) on an app compiled in x86

    So I have a document manager application that uses an Adobe Reader plug-in to view PDF files. I've been using the same dll for a few years and all has worked well until some of my clients started using Reader 11. It's likely an environmental issue si

  • How do i block a website in my firefox browzer?

    I want to block some website,, but i can't find this option... could you tell me how can i do it?

  • How much is my early termination fee?

    I have an iphone 5 that I bought with a 2-year contract. I'm leaving the country in september so that'd be 2 months before my contract ends. How much early termination fee do I have to pay? How do I find out?

  • Very simple question on se93

    Hi Experts, I have executed se93 and displayed the z transaction. I want to see the codes written inside for the z transaction code. How to see the codes? I can see following Transaction Code  Packege Transaction Text Can you please let me know where