How can I control incremental value in ODI?

Hi guys,
I have to do something on the target table by insert a incremental value to some field that need to automatically increase by 1.
Although , I tried with a variable that query a sequence from oracle but the output to the target table was the same number not the automatic increase number.
eg. I have a variable name "AUTO_INC" on ODI and "AUTO_SEQ" which is a sequence on oracle target site.
This variable has this statement
select AUTO_SEQ.nextval from dual;
So,This is my fault because after testing.
This variable was executed once.
The output from this variable is 1.
After I executed the interface. And check the result in the target table it shows that the field that contain incremental value is 1 in all rows.
Any idea?
By the way ,
I have tried the sequence and has some trigger on the target table.
And Let oracle do the automatic generate a sequence number not the ODI.
But it has a problem with number of the sequence that oracle generate was skipped.
eg. first time I execute the interface . The field that bind to the automatic sequence was fine (increasing value by 1 with sequnce)
Let's say I have 187 rows , So the last sequence number is 187.
After that I execute the interface again , and the next sequence number should be 188
But the result was 211.
I don't know why because this table nobody touch it excepts me.
Why the sequence number was skipped.
My SQL to create a Sequence:
create sequence AUTO_SEQ
start with 1
increment by 1
nomaxvalue;
A trigger that binding with target table :
create trigger test_trigger
before insert on test
for each row
begin
select AUTO_SEQ.nextval into :new.id from dual;
end;
Thanks in advance for every ideas.

Hi ananda,
I have an error on step insert into flow table with this error
*2287 : 42000 : java.sql.SQLException: ORA-02287: sequence number not allowed here*
here are statement on this step
insert /*+ APPEND */ into ODI_TMP.I$_TEST2
     ID,
     NAME,
     ID_KEY,
     IND_UPDATE
select      
     TEST.ID,
     TEST.NAME,
     auto_seq.nextval,
     'I' IND_UPDATE
from     CUST_DW_DEV.TEST TEST
where     (1=1)
minus
select
     ID,
     NAME,
     ID_KEY,
     'I'     IND_UPDATE
from     CUST_DW_DEV.TEST2
I have an procedure name "create sequence" which have 2 steps
step one : drop sequence with ignore error and has following code
drop sequence auto_seq
step two : create sequence with following code
CREATE SEQUENCE auto_seq
MINVALUE #TEST.auto_inc
MAXVALUE 5888888
START WITH 1
INCREMENT BY 1
I have a variable name "auto_inc" and has an SQL with following
select nvl(max(auto_id),1) from test2
(need to change from 9000 to 1 because if I didn't change it had an error with 4006 : 22023 : java.sql.SQLException: ORA-04006: START WITH cannot be less than MINVALUE)

Similar Messages

  • How can I control the size of a cell in the GridBagLayout?

    Hi,Swing Gurus
    I am developing a swing-based program using JBulider5 enterprise.
    It seems to me that the GridBagLayout is really a hard nut!
    How can I control the size of a cell in the GridBagLayout?
    It seems that I cann't control the size of a cell directly.
    But how the size of a particular cell is determined when I switch the layout manager from XYLayout to GridBagLayout?
    Thx in advance!
    Regards,
    Justine

    hi,i have not done what you are asking but there are fields like
    COLUMNWIDTH, MINSIZE, MAXGRIDSIZE, PREFEREDSIZE to which you can set the appropriate values and test for your need.hope this helped.bye martian.

  • How can I control the size of the af:InputText?

    Hi,
    How can I control the size of the 'af:InputText' on the UI, without using columns & rows attributes. Even though I am using width & height attributes, the changes are not getting reflected in the UI.
    Thanks,
    Rajesh.

    Hi,
    It is inside a 'af:PanelBox'. So, the parent container also determines the size of the child? Here I need a create a 'pidgin chat window' kind of an interface with a fixed size top-level container, inside which I willl put all my components. The code looks something like this:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" partialTriggers="it1">
    <af:messages id="m4"/>
    <af:form id="f1" partialTriggers="it1">
    <af:panelBox text="" id="pb1" background="dark" type="stretch"
    titleHalign="start" ramp="highlight"
    inlineStyle="width:350pt; height:500pt; margin:0.5pt; padding:0.5pt; border-width:0.5pt; "
    partialTriggers="it1">
    <af:spacer height="15pt" id="s1"/>
    <af:inputText id="ot1"
    columns="82" rows="25" wrap="hard"
    partialTriggers="it1"
    value="#{ChatClientBean.chatLog}"
    binding="#{ChatClientBean.outputChatTextBox}"
    visible="false">
    </af:inputText>
    <af:spacer height="27pt"/>
    <af:inputText id="it1" inlineStyle="width:200pt; height:100pt;"
    valueChangeListener="#{sessionScope.ChatClientBean.sendMessage}"
    autoSubmit="true" partialTriggers="it1"
    binding="#{ChatClientBean.inputChatText}"/>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Thanks,
    Rajesh.

  • How can i find the value category code in CJVC

    Hi Gurus
    how can i find the value category code in CJVC and which tables its stored.can any one tell me.please please

    Read TPIK3 in an internal table, then search COEP-KSTAR in this table, with KSTAR between TPIK3-KSTRF and TPIK3-KSTRT, and other keys like Controlling Area and application/component (eg "PS" in project-system as in CJVC or "PM" in Maintenance as in IW33, multiple application use this table). You can also use a FM like PS_FIND_ACPOS_FOR_KSTAR.
    Regards,
    Raymond

  • How can I automatically increment an auto incremented column?

    Hello!
    I have a table with an auto incremented "id" field.
    It looks like this:
    id (PK, auto_increment) name address phone
    I would like to make an insertion like:
    INSERT INTO Person (name, address, phone) VALUES (?,?,?)
    ...but it says that all fields have to be used.
    I get
    java.sql.SQLException: Field 'id' doesn't have a default value
    How can I bypass this?
    I have looked at [this example|http://blog.taragana.com/index.php/archive/java-how-to-get-auto-increment-values-after-sql-insert/] , but it didn´t work for me, it still says the "id" column has not a default value:

    Sorry, it is a MySQL database.
    The table consists of 4 columns:
    id (PK, auto_increment)
    name (Varchar)
    address (Varchar)
    phone (Varchar)
    If I use PHPMyAdmin to insert a new row, then this query works:
    INSERT INTO `mydb`.`person` (
    `id` ,
    `name` ,
    `address` ,
    `phone`
    VALUES (
    NULL , 'Test', 'Roxxor', 'Europe', '12345'
    );{code}I tested to use the method setNull() on the first column in the preparedStatement but it didn&acute;t work.
    Do you need more info from me to be able to help me?
    I have tried this (but got the error that the "Field 'id' doesn't have a default value"):
    [code]con.setAutoCommit(true);
                String query = "INSERT INTO person(id, name, address, phone) VALUES (?, ?, ?, ?)";
                PreparedStatement stmt = con.prepareStatement(query);
                stmt.setNull(1, java.sql.Types.NULL);
                stmt.setString(2, name); 
                stmt.setString(3, address);     
                stmt.setString(4, phone); 
                stmt.executeUpdate(); 
                stmt.close();[/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How can i control weather a custom transaction is executed

    How can i control whether a custom transaction containing delete sql statement is executed using the results of a record set?
    The custom transactions dialog does no allow me to use anything more than sql and has no conditions so i cannot control flow their.
    Triggers seem not to be able to access record sets defined on the same page and internally seem able to perform select staments but unable to return result sets.
    Please help if you can ?

    What exactly are you trying to do?
    The following partial code-snippet checks a value on a form and performs a sql select query if a condition is met, it could perform any valid sql...
    //start GWB_SetSubscribedToThread trigger
    function GWB_SetSubscribedToThread(&$tNG) {
    //Get the current values from the form
    $threadid = $tNG->getColumnValue('NbForumMessageID');
    $userid = $tNG->getColumnValue('CreatedBy');
    $subscribed = $tNG->getColumnValue('Subscribe');
    //Check current subscription
    $query = "SELECT ms_RandomKey FROM messagesubscribe WHERE ms_MessageTypeID = 1 AND ms_ThreadID = " . $threadid . " AND ms_UserID = " . $userid ;
    // This syntax doesn't work for some reason??
    //$result = $tNG->connection->execute($query);
    //This syntax does work
    $result = mysql_query($query);
    if (!$result) {
    $message = 'Invalid query: ' . mysql_error() . "\n\n";
    $message .= 'Query String: ' . $query;
    $message = nl2br($message);
    die($message);

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

  • How can I pass field value betwen view in ICWC?

    Hi experts,
    I am new to this BSP programming. I have some requirements to modify standard ICWC in CRM 5.0
    Hope can get some advices and helps here.
    I have added a new field called <status> to context note SEARCHCUSTOMER in BupaSearchB2B view and also the same field name to context note CUSTOMER in BupaCreate view.
    I have added the field into both the HTM views and able to execute thru WebClient. However, I have one problem in passing the <status> value from BupaSearchB2B view  to the BupaCreate view when I click on the 'create' button.
    I do search and saw this thread How can I pass field value beetwen view in IC Web Client? , but i cant figure out how it works.
    Do I need to create the field <status> to context note CUSTOMER in BupaSearchB2B? Currently the context note does not have any attributes.
    Really appreciate for any help.
    Edited by: mervyn tay on Apr 7, 2009 11:42 AM

    solved by myself...
    code in the CREATE_ACCOUNT method.
            ev_entity->set_property( iv_attr_name = 'ZZICNO'
                                     iv_value = lv_icnum1 ).

  • How can I get command values from a VI executed by reference ? NEWBIE

    Hi,
    I'm running a sub-vi in a "Secondary Front Face" (excuse for the
    translation if not correct, I'm working on a French version). In order
    to run this VI, I pass a reference. All is working fine but I don't
    know how can I get the values entered by the user in this VI ?
    Actually I run a main VI wich contains a "Secondary Front Face" (this
    SFF is contained in a tabbed pane). In my diagramm, I pass a reference
    to another VI (by the name of the file *.vi). If my user enter a word
    in a text field, I would like to be able to get it in my main app.
    Thanks for your help.

    Hello,
    You might take a look at the following tutorial for more information about calling a VI by reference. It's got some great visuals and examples.
    Tutorial: Calling a VI by Reference
    You might also consider just calling the secondary VI as a simple subVI, if you can spare the memory space when loading the main application, as this is the easiest way to input and output VI values.
    I hope this helps! Please let me know if I can be of any further assistance.
    Liz F
    National Instruments

  • How can I control selection on a PDF

    I have Acrobat Pro 9 Pro build 9.4.6 and am constantly exporting documents from indesign to .pdf, and also building docs in the 'combine' feature from mixed pages. 
    While everything seems to go reasonably well, I have a few problems that are due either to my ignorance, or bugs.
    1.  The biggie; How can I control what I select, for the purpose of copying, moving and deleting?   When I drag the touch-up object tool over my selection, it selects what it wants to most of the time; sometimes it selects (i.e., puts a light blue box around) the entire page, instead of my selection (no pages are scanned).  There are very few instances when I get exactly what I want; there are usually a few lines above or below, no matter how careful I am in my selection.  The funny thing is that this is not a constant; sometimes, the tool works perfectly!  and I have my heart in my mouth every time I really need it to work, hoping that it will not force me to go back to Indesign to make minor corrections.   Perhaps my problems are connected to options I select when exporting my indds, but I've tried checking, clearing, and selecting various combinations and nothing seems to work.
    Sometimes, the text selection tool is strange; a wide blue swath develops over the selected text, even though it is still usually possible to  edit the text in this condition.  And BTW, is there anything to do about the fact that some text can't be edited at all because a suitable font replacement can't be found?  Can't a font be added somehow that will take care of this?
    2. Headers and Footers; fairly effortless, but if the footer contains two rows and I want them centered, the second row looks centered in the preview but not in the doc.  I have to go back to the footer dialog and guesstimate how many spaces to place before the second row to get it to look centered.  Also, is there any way to place a logo in a header?  That would be one of my requests for the next version of Acrobat, if not.
    3.Hyperlinks; they don't always work,even though I check Hyperlinks in the Export settings.  Sometimes yes, sometimes no.
    4.  Typwriter toolbar; it also seems to offer font and size changes whenever it feels like it, and I've tried all different orders of typing, selecting, etc.

    It's me again, sorry!  I wanted to save what I'd written, and my message popped up to the board.
    Thank you for any advice anyone has!
    PS  My indd and acrobat are the same version, as they came in the same package (CS4).  Windows XP sp3.
    Oh, one more thing I just remembered, as long as I'm complaining; sometimes if I place an object (the logo) and copy it to another page, it disappears on the original page, as if I've cut it.  Any fix for that?  (strange how I can edit tmy 'reply' but not my original post...well, at least I found where to ask a question fairly quickly!)

  • How can I get the value of "Warehose" column in a form

    How can I get the value of "Warehouse" column in the form below (I mean what table that contain this value):
    Production Supervisor >> Batches >> (Button) Material Details >> (Button) Line Allocations
    Well, for more clearly! My problem is I must have the Unit Cost of Items, so I've got it in the cm_cmpt_dtl (table), but if I want to, I must create a relation that require 2 filed, they're Item_ID and Whse_Code.
    There's no problem with Item_ID, but Whse_Code seem to be the Mission Impossible (hix, I hate that film!!!!)
    I wonder if It was right to post this topic here. But anyway I just post my question here, hope I could get some help.

    wow, many, many, many.... and many thanks!
    Just add a tiny modify to check out the Batch_type
    doc_id = (select batch_id from gme_batch_header where batch_no='&batch_number' and batch_type = 0)
    Because the batch_no can be duplicated as we also create Batch and Filrm Planned Order.
    Many thanks for your support!
    P/S: Sorry for my terrible English :P

  • How can I control the zoom on my mac mouse?

    How can I control the zoom function on my mouse? In the middle of working on things my hand will rub the mouse by accident and all of a sudden the context within the screen is large. I have no idea of how to work this feature on my mouse and most times to get it to return to normal, I have to escape out of the work I am performing.

    If you are pressing the "Control" button on the Mac keyboard, scrolling up will zoom in and scrolling down will zoom out. You can disable this if it annoys you through System Preferences > Universal Access. If you are using Mountain Lion, it would be System Preferences > Accessibility.
    Uncheck the in the "Seeing" or "Zoom" section that says "Use scroll gesture with modifier keys to zoom".  It may be slightly different if you have an older OS X version. I have Mountain Lion and am going off of memory on the older versions.

  • How can I return multiple values with PL/SQL Web Services

    Hi,
    I'm new to developping Web Services. I'm doing some tests with JDeveloper and OC4J on my local machine with a Web Services based on a PL/SQL function within a package. Right now that function only returns one value. So the xml response only has one output.
    I'd like to know how can I return multiple values with my PL/SQL Web Service. For example, if I want to return an employee's name and id? And that the xml contains two output : <employee>, <empid>?
    Reginald
    ps : I have searched the forum and I couldn't find an answer to this question, if that has been discussed AND answered before, can you please post the link? Thanks

    Alright, I actually found my answer. Since this was asked I think as a followup somewhere else I'll give my answer.
    It is very simple, all you have to do is create an Object Type and then Return that object type. After that, JDeveloper will take care of everything and you will have an xml response with multiple values. Here
    {color:#ff0000}
    create or replace TYPE person AS OBJECT
    ( id_interv number,
    first_name VARCHAR2(50),
    last_name VARCHAR2(50),
    date_birth date
    );{color}
    Then your function used in your Web Service should look something like this :
    {color:#ff0000}
    function info_emp (p_empno IN VARCHAR2) RETURN person AS
    l_emp person := person(-1,'','','');
    BEGIN
    SELECT first_name
    ,last_name
    ,emp_no
    INTO l_emp.first_name
    ,l_emp.last_name
    ,l_emp.emp_no
    FROM emp
    WHERE upper(emp_no) = upper (emp_no);
    {color}
    {color:#ff0000}
    RETURN l_emp;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    l_emp := person (-1,'n/a','n/a','n/a');
    RETURN l_emp ;
    END info_emp;{color}
    {color:#ff0000}{color:#000000}After that, this is what the xml response looks like :{color}{color}
    &lt;first_name xsi:type="xsd:string"&gt;John&lt;/first_name&gt;
    &lt;last_name xsi:type="xsd:string"&gt;Doe&lt;/last_name&gt;
    &lt;emp_no xsi:type="xsd:string"&gt;0250193&lt;/emp_no&gt;

  • How can I pass a value into a page fragment?

    How can I pass a value into a page fragment?
    I am implementing four search screens. And the only thing different about them will be their backing bean.
    So I’d like to do something like have four pages, each which retrieves its appropriate backing bean, sets that bean to a variable, and then includes a page fragment which contains the generic search page code (which will make use of that variable).
    The code in the four pages would be something like this:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <c:set var="searchPageBackingBean"
    value="#{pageFlowScope.employeeSearchPageBean}"
    scope="page"/>
    <jsp:include page="./SearchPageBody.jsff"/>
    </jsp:root>
    At this point, what I’m seeing is that the fragment page, SearchPageBody.jsff, has no visibility of the searchPageBackingBean variable, either referencing it as #{pageFlowScope.searchPageBackingBean} or just #{searchPageBackingBean}

    The following will work, assuming you are needing to access a managed bean:
    Put this in the parent page:
    <c:set var="nameOfSearchPageBackingBean"
    value="employeeSearchPageBean"
    scope="request"/>
    Put this in the child, SearchPageBody.jsff:
    <c:set var="searchPageBean"
    value="#{pageFlowScope[nameOfSearchPageBackingBean]}"
    scope="page"/>

  • How can I control a button from one swf file to another swf file?

    Hi,
    I have a main.swf file. From that file I am accessing the external.swf file which is an external file.
    Now, how can I write code on my main.swf file for the button which is on my external.swf file?
    Activities.MainPanel.close_btn.addEventListener(MouseEvent.CLICK, btnClickClose);
    Activities.MainPanel.close_btn (This buttons is actually on external.swf file, but I want to write code on main.swf file to execute it on external.swf) how can I control one swf button on other swf file?
    Thanks.

    Here's some example code that you should be able to adapt to your needs.
    // create a new loader object instance...
    var loader:Loader = new Loader();
    // make the download request...
    var request:URLRequest = new URLRequest("external.swf");
    // add a complete event listener to the loader
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    // start the actual loading process...
    loader.load(request);
    // create a new empty movieClip instance, you will put the loaded movie into this movieClip once its loaded
    var externalMovie:MovieClip;
    // this function is called when the download has finished and the file is ready to use...
    function completeHandler(event:Event):void {
       // set the contents of the loaded movie to the new empty movieClip...
               externalMovie = MovieClip(event.target.content);
       // add this new movie to the display list...
       addChild(externalMovie);
    Now you can refer to the loaded movie with the instance name "externalMovie". So if, for instance, you want to address a button in the loaded movie, you could write something like this on the main timeline:
    externalMovie.addEventListener(MouseEvent.CLICK, btnClickClose);
    function btnClickClose(event:MouseEvent):void {

Maybe you are looking for

  • TS3999 iCloud + iCal + ML sync issues

    Hey guys, I recently purchased a late-2011 13" MBP and upgraded it to ML.  I did not have any prior issues with my iPhone/Mac/iPad/Black MacBook syncing together with iCloud, which is why I'm perplexed after countless Google searches and resets with

  • Help for website?

    Dear adobe readers! This week we launched a new ecommerce shop. And we want to have the design as good as possible. So for you guys the question if you can take a look at the design of the shop and give me advice about making it better and just let m

  • I have 2 pages up I can't see how to exit one page and still have the other page up I have to close an re click on the icon

    I do not see a way to close one page. I may have 3or4 different pages up but I cannot close one page with out having to close fire fox entirely. I have to go back to your icon and start all over. Thanks Dave In Austin Texas

  • What are the fixes/updates on iOS 4.3.2?

    can i ask for the list of fixes or updates of the latest iOS?

  • Problem with msn-hotmail

    i'm new with the "macworld" , it's been only 2 weeks since i bought my macbook and my problem is that i can't enter msn and hotmail. Are there any settings that i have to adjust and i'm not aware of? any suggestion would very helpful! thanks macbook