Insert to 2 Tables and Auto-Increment

I applied the Insert To 2 Tables Wizard and then added an Auto-Increment
behavior to auto increment a field in the master table. BUT - I also
need to auto-increment a field in the detail table. The AutoIncrement
behavior only offers fields for the master table. So - how do I
auto-increment the detail table?
I know I could create a custom trigger - but how do you grab the primary
key from the DETAIL table?
Alec Fehl, MCSE, A+, ACE, ACI
Adobe Community Expert
AUTHOR:
Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
Publications)
Welcome to Web Design and HTML (Labyrinth Publications)
CO-AUTHOR:
Microsoft Office 2007: Essentials (Labyrinth Publications)
Computer Concepts and Vista (Labyrinth Publications)
Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
Internet Systems and Applications (EMC Paradigm)

Got it. Advanced tab of the AutoIncrement server behavior - remove the
master table and add the detail table. Then return to basic tab and add
the appropriate field.
Alec Fehl, MCSE, A+, ACE, ACI
Adobe Community Expert
AUTHOR:
Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
Publications)
Welcome to Web Design and HTML (Labyrinth Publications)
CO-AUTHOR:
Microsoft Office 2007: Essentials (Labyrinth Publications)
Computer Concepts and Vista (Labyrinth Publications)
Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
Internet Systems and Applications (EMC Paradigm)

Similar Messages

  • Insert data into Access with Auto-Increment column

    Is there anyone out there that has come across this problem I am experiencing?
    I have a form I'm trying to submit to an Access DB that has an Auto-Incremented Table Column. I have followed Stefan Cameron's instructions to a "T" on his blog page here:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    but I keep getting the following error"
    GeneralError: Operation failed.
    XFAObject.open:10:XFA:form1[0]:mysubform[0]:myEIFform[0]:overflowLeader[0]:Submit[0]:click
    open operation failed. [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.
    My OLEDB Connection Record Source is the SQL Query which reads: SELECT FedTaxID, LegalID FROM dbtest; My simple test DB is Access and its only 3 columns; dbID, FedTaxID, LegalID. dbID is the Auto-Incremented Column.
    If I remove the Auto column from my DB table it inserts just fine but I get this error:
    GeneralError: Operation failed.
    XFAObject.open:10:XFA:form1[0]:mysubform[0]:myEIFform[0]:overflowLeader[0]:Submit[0]:click
    ado2xfa operation failed. Item cannot be found in the collection corresponding to the requested name or ordinal.
    I've looked over alot of the blogs and other help forums and there's info on Selects, I don't find much on Inserts.
    Can anyone direct me in the right direction? Thank you.

    First, please pay attention to the forum in which you are posting.  This particular post would be more appropriate to tsql rather than datamining.  Second, what specific problem are you trying to solve.  The code you posted appears to be
    correct.  I will say that your DataTable will likely be a source of future problems if it contains only the 2 columns.

  • Hibernate data insertion not working with oracle auto increment

    hi i have created a table and the id is set to auto increment by a sequence trigger pair
    when i manually giving value to id its working fine
    but when i tried without maually giving the id i am getting this error
    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.pojo.Example
    at org.hibernate.id.Assigned.generate(Assigned.java:33)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
    at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
    at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
    at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
    at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
    at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
    at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
    at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
    at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
    at hibernetsample.Main.main(Main.java:30)

    >
    hi i have created a table and the id is set to auto increment by a sequence trigger pair
    when i manually giving value to id its working fine
    but when i tried without maually giving the id i am getting this error
    org.hibernate.id.Assigned
    >
    That is because you are using the hibernate 'assigned' generator which, by definition
    >
    lets the application to assign an identifier to the object before save() is called.
    This is the default strategy if no <generator> element is specified.
    >
    For your use case you can use the 'sequence' generator.
    The valid generator options and one way to use a sequence generator is shown in this article
    http://www.hibernate-training-guide.com/identifiers-generators.html
    The hibernate section of this article also uses a trigger with sequence generator
    http://blog.lishman.com/2009/02/auto-generated-primary-keys-in-oracle.html
    You should check the hibernate documention and tutorial for examples or search 'hibernate generator sequence example'

  • Prefixing and auto-increment field

    Hello
    I have a web application (php/mySQL) that has an auto-increment primary key field called job_id.
    Could anyone help me add a prefix to this?
    I want to add the year and month (YYMM/) in front of the field (e.g. 0811/1234 then 0811/1235 assuming current month and year is Nov 2008).
    Maybe Im wrong about adding the prefix to the primary key. Should I maybe add an additional field to maintain this?
    Any advice greatly appreciated...
    Regards
    Paul

    Hi Paul,
    MySQL table and column names may only consist of letters, underscores and numbers anyway, so the date format you´d like to use would lead to errors due to the forward slashes.
    Maybe Im wrong about adding the prefix to the primary key.
    I don´t know what you want to achieve with this approach, but I´d really leave the name of the Primary Key column "as is" and use a different column for storing data which contains such date values.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Inserting in multiple tables and joining data

    I am using DW8, PHP and MySQL.
    I've created a database for software inventory. One table is
    a list of software products and the other is the licensing
    information. I set it up this way because we have a product such as
    Windows XP that will have different licenses. But the end result
    will be someone clicking on Windows XP and seeing all licenses for
    that product.
    I've created a page to insert into the software table and one
    for the licensing information. Now I need to make a third page so
    that the user can select the product from a dropdown menu and then
    enter the licensing information. I have join setup between the
    tables in the MySQL backend. How do I tell Dreamweaver that the
    license being entered is related to the correct product?
    Thanks!

    Nevermind, I figured out how to do this.

  • Using Bulk operations for INSERT into destination table and delete from src

    Hi,
    Is there any way to expediate the process of data movement?
    I have a source set of tables (with its pk-fk relations) and a destination set of tables.
    Currently my code as of now, is pickin up the single record in cursor from the parentmost table, and then moving the data from other respecitve tables. But this is happening one by one... Is there any way I can make this take less time?
    If I use bulk insert and collections, i will not be able to use the DELETE in the same block for same source record.
    Thanks
    Regards
    Abhivyakti

    Abhivyakti
    I'm not 100% sure how your code flows from what you've stated, but generally you should try and avoid cursor FOR LOOPS and possibly BULK COLLECTING.
    I always follow the sequence in terms of design:
    1. Attempt to use bulk INSERTS, UPDATES and/or DELETES first and foremost. (include MERGE as well!)
    2. If one cannot possibly do the above then USE BULK COLLECTIONS using a combination of RETURNING INTO's and
    FORALL's.
    However, before you follow this method and if you relatively new to Oracle PL/SQL,
    share the reason you cannot follow the first method on this forum, and you're bound to find some
    help with sticking to method one!
    3. If method two is impossible, and there would have to be a seriously good reason for this, then follow the cursor FOR LOOP
    method.
    You can combine BULK COLLECTS with UPDATES and DELETES, but not with INSERTS
    bulk collect into after insert ?
    Another simple example of BULK COLLECTING
    Re: Reading multiple table type objects returned
    P;

  • On submit perform an insert on one table and an update on aother table

    I am trying to perform and insert on the table one table (the wizard created my form the insert is going against the table that I created using the wizard) and on the form is on field that is also in another table. Therefore, I am trying to perform an update on one attribute of one table and a insert into another table. How do I do this in apex?

    If you have used wizard to create form, then you may see a process of type 'Automatic Row Processing (DML)' in your page which will perform INSERT/UPDATE/DELETE on your form table. Here you can see APEX performs INSERT only when REQUEST is in 'INSERT, CREATE, CREATE_AGAIN, CREATEAGAIN'
    So create one more PL/SQL page process which will execute at 'on Submit after validations' and write update process as follows
    begin
    -- pseudo table/columns
    update tbl_second
    set col1 = :p1_item
    where pk_col = :p1_pk_item;
    end;Make this process conditional so that it will perform UPDATE only when request value is in 'INSERT, CREATE, CREATE_AGAIN, CREATEAGAIN' ( i.e. only when you are inserting into your form table)
    Cheers,
    Hari
    p.s. I think you may also need to update the second table when some-one updates your form table.
    Edited by: Hari_639 on Oct 26, 2009 9:46 AM

  • Query for inserting data into table and incrementing the PK.. pls help

    I have one table dd_prohibited_country. prohibit_country_key is the primary key column.
    I have to insert data into dd_prohibited_country based on records already present.
    The scenario I should follow is:
    For Level_id 'EA' and prohibited_level_id 'EA' I should retreive the
    max(prohibit_country_key) and starting from the maximum number again I have to insert them
    into dd_prohibited_country. While inserting I have to increment the prohibit_country_key and
    shall replace the values of level_id and prohibited_level_id.
    (If 'EA' occurs, I have to replace with 'EUR')
    For Instance,
    If there are 15 records in dd_prohibited_country with Level_id 'EA' and prohibited_level_id 'EA', then
    I have to insert these 15 records starting with prohibit_country_key 16 (Afetr 15 I should start inserting with number 16)
    I have written the following query for this:
    insert into dd_prohibited_country
    select     
         a.pkey,
         b.levelid,
         b.ieflag,
         b.plevelid
    from
         (select
              max(prohibit_country_key) pkey
         from
              dd_prohibited_country) a,
         (select
    prohibit_country_key pkey,
              replace(level_id,'EA','EUR') levelid,
              level_id_flg as ieflag,
              replace(prohibited_level_id,'EA','EUR') plevelid
         from
              dd_prohibited_country
         where
              level_id = 'EA' or prohibited_level_id = 'EA') b
    My problem here is, I am always getting a.pkey as 15, because I am not incrementing it.
    I tried incrementing it also, but I am unable to acheive it.
    Can anyone please hepl me in writing this query.
    Thanks in advance
    Regards
    Raghu

    Because you are not incrementing your pkey. Try like this.
    insert
       into dd_prohibited_country
    select a.pkey+b.pkey,
         b.levelid,
         b.ieflag,
         b.plevelid
       from (select     max(prohibit_country_key) pkey
            from dd_prohibited_country) a,
         (select     row_number() over (order by prohibit_country_key)  pkey,
              replace(level_id,'EA','EUR') levelid,
              level_id_flg as ieflag,
              replace(prohibited_level_id,'EA','EUR') plevelid
            from     dd_prohibited_country
           where level_id = 'EA' or prohibited_level_id = 'EA') bNote: If you are in multiple user environment you can get into trouble for incrementing your PKey like this.

  • How to insert image into table and to in Oracle 9i intermedia?

    Mr Lawrence,
    I want to ask something:
    I use Oracle 9i intermedia
    If i use this script:
    CREATE TABLE images (
    file_name VARCHAR2(100) NOT NULL,
    image ORDSYS.OrdImage
    then
    CREATE OR REPLACE DIRECTORY imgdir AS 'd:/data';
    then
    INSERT INTO images (file_name, image)
    VALUES ('tree', ORDSYS.ORDImage.init('file','imgdir','tree.jpg' ));
    I put tree.jpg in directory d:/data in my hard drive.
    Is my tree.jpg file had already get in to my images table?
    I'm little confuse, because when i check my table with this script:
    select file_name, i.image.getWidth() from images i;
    it's show that my i.image.getWidth() for file_name tree is empty.. that mean my tree.jpg doesn't get in to my table.. am i correct?
    N also i want to ask how to display to screen all of my image from images table?
    Is it posible Oracle 9i intermedia to support display image from table?
    How?
    thanks Mr Lawrence

    -- First step would be to create a directory in oracle and map it to the folder where your image resides.
    create directory image_dir as *'c:\image_dir';*
    Then you would have to use a procedure to insert the image in your table. SO first create a table to hold the image. Note that you have to use a BLOB to insert the image.
    CREATE TABLE test_image
    ID NUMBER,
    image_filename VARCHAR2(50),
    image BLOB
    Now let's write the procedure to insert the image in the table above.
    CREATE OR REPLACE PROCEDURE insert_image_file (p_id NUMBER, p_image_name IN VARCHAR2)
    IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := BFILENAME ('image_DIR', p_image_name);
    -- insert a NULL record to lock
    INSERT INTO temp_image
    (ID, image_name, image
    VALUES (p_id, p_image_name, EMPTY_BLOB ()
    RETURNING image
    INTO dst_file;
    -- lock record
    SELECT image
    INTO dst_file
    FROM temp_image
    WHERE ID = p_id AND image_name = p_image_name
    FOR UPDATE;
    -- open the file
    DBMS_LOB.fileopen (src_file, DBMS_LOB.file_readonly);
    -- determine length
    lgh_file := DBMS_LOB.getlength (src_file);
    -- read the file
    DBMS_LOB.loadfromfile (dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE temp_image
    SET image = dst_file
    WHERE ID = p_id AND image_name = p_image_name;
    -- close file
    DBMS_LOB.fileclose (src_file);
    END insert_image_file;
    Now execute the procedure to insert the image.
    EXECUTE insert_image_file(1,'test_image.jpg');
    Thanks,
    Aparna

  • Auto Increment ID Field Table in the Oracle Database (insert new record)

    I have been using the MySQL. And the ID field of the database table is AUTO INCREMENT. When I insert a new record into a database table, I can have a statement like:
       public void createThread( String receiver, String sender, String title,
                                 String lastPostMemberName, String threadTopic,
                                 String threadBody, Timestamp threadCreationDate,
                                 Timestamp threadLastPostDate, int threadType,
                                 int threadOption, int threadStatus, int threadViewCount,
                                 int threadReplyCount, int threadDuration )
                                 throws MessageDAOSysExceptionand I do not have to put the ID variable in the above method. The table will give the new record an ID number that is equivalent to the ID number of the last record plus one automatically.
    Now, I am inserting a new record into an Oracle database table. I am told that I cannot do what I am used to doing with the MySQL database.
    How do I revise the createThread method while I have no idea about what the next sequence number shall be?

    I am still very confused; in particular, the Java part. Let me try again.
    // This part is for the database table creation
    -- Component primary key sequence
    CREATE SEQUENCE dhsinfo_page_content_seq
        START WITH 0;
    -- Trigger for updating the Component primary key
    CREATE OR REPLACE TRIGGER DHSInfoPageContent_INSERT_TRIGGER
        BEFORE INSERT ON DHSInfoPageContent //DHSInfoPageContent is the table name
        FOR EACH ROW WHEN (new.ID IS NULL) // ID is the column name for auto increment
        BEGIN
            SELECT dhsinfo_page_content_seq.Nextval
            INTO :ID
            FROM DUAL;
        END;/I am uncertain what to do with my Java code. (I have been working with the MySQL. Changing to the Oracle makes me very confused.
       public void updateContent( int groupID, String pageName, int componentID,
                                  String content, Timestamp contentCreationDate )
                                   throws contentDAOSysException
       // The above Java statement does not have a value to insert into the ID column
       // in the DHSInfoPageContent table
          Connection conn = null;
          PreparedStatement stmt = null;
          // what to do with the INSERT INTO below.  Note the paramether ID.
          String insertSQL = "INSERT INTO DHSInfoPageContent( ID, GroupID, Name, ComponentID, Content, CreationDate ) VALUES (?, ?, ?, ?, ?, ?)";
          try
             conn = DBConnection.getDBConnection();
             stmt = conn.prepareStatement( insertSQL );
             stmt.setInt( 1, id ); // Is this Java statement redundant?
             stmt.setInt( 2, groupID );
             stmt.setString( 3, pageName );
             stmt.setInt( 4, componentID );
             stmt.setString( 5, content );
             stmt.setTimestamp( 6, contentCreationDate );
             stmt.executeUpdate();
           catch
           finally

  • Auto Increment column in database table

    Hello experts, I am using oracle 11g database at windows 7.I have to create a sequence object and a table with an auto increment ID column.For this I have created a trigger before insert to select next sequence from a sequence object. It works well but Now I have the current sequence is 7 and there are 6 records inserted in table. Now I delete two records.Thus I have only 5 records in table but my current sequence is still 7.So if I put it in id column then a new record will be inserted in table with 7 ID number after 5th ID number.I want this record should be inserted with 6 Id number. For this I tried to not use sequence object.I tried a pl/sql trigger before insert, which will count the all records in table and after increment i put it in ID column to insertion....Is this a professional way..? thank You regards aaditya

    979801 wrote:
    Hello experts, I am using oracle 11g database at windows 7.I have to create a sequence object and a table with an auto increment ID column.For this I have created a trigger before insert to select next sequence from a sequence object. It works well but Now I have the current sequence is 7 and there are 6 records inserted in table. Now I delete two records.Thus I have only 5 records in table but my current sequence is still 7.So if I put it in id column then a new record will be inserted in table with 7 ID number after 5th ID number.I want this record should be inserted with 6 Id number. For this I tried to not use sequence object.I tried a pl/sql trigger before insert, which will count the all records in table and after increment i put it in ID column to insertion....Is this a professional way..? thank You regards aaditya
    Sequences only guarantee unique numbers.  You cannot (and should not) attempt to create gapless sesquences.  That's not how oracle works and will not scale to a multi user application.
    Imagine two people try to insert records at the same time (and have yet to commit), the trigger you create will count the number of records and determine there are 5 records, so assign the next number of 6, for both people who are inserting records.  The first person to commit will get their data saved, and assuming you have a unique constriaint on that id, the second person will raise a duplicate key on insert or suchlike error.
    Gapless sequential numbers are not appropriate to multi-user environments.  Such requirements are often given by managers or business people who do not understand the technology.
    Think of it in terms of a real world office, but with people using a paper system instead of a computer.  The only way you can try to guarantee people get the next number and also re-use numbers that have been deleted is to have a single place where each person in the office goes to, to fetch the next number, and they have to queue up behind each other to get the next one off the list.  But if someone has removed an old record, they've got to wait in the same queue to go and put that number back in the pot for someone else to use.  It just doesn't work, even in a manual system.  Yes, people can guarantee that they're only getting unique numbers that nobody else is using, but they cannot guarantee that they are reusing and filling gaps etc.  It's an unrealistic expectation.

  • AUTO Increment on TABLE or TRIGGER

    I have a table that I created. I want the first column in the table to auto increment. Some of the examples I have seen create a sequence, and then do the update on a trigger?
    Is is possible to just start with 1 and increment by one when something is inserted into the table in the CREATE or ALTER Table syntax?
    Or Do I have to create a sequence, and trigger for this?

    I have already created a trigger for this table. I am doing an insert.
    IF UPDATE THEN
      INSERT INTO EQUIPMENT_USER_DATA_AUDIT (
        equipment_id,
        old_cpe_status,
        new_cpe_status,
        cpe_status_changed,
        old_ne_status,
        new_ne_status,
        ne_status_changed,
        date_modified,
        modifiers_name)
    VALUES (
        :new.equipment_id,
        :old.cpe_status,
        :new.cpe_status,
        (CASE WHEN :old.cpe_status = :new.cpe_status
               THEN 'N'
               ELSE 'Y'
         END),
        :old.ne_status,
        :new.ne_status,
        (CASE WHEN :old.ne_status = :new.ne_status
               THEN 'N'
               ELSE 'Y'
         END),
        SYSDATE,
        SYS_CONTEXT ('USERENV','CURRENT_SCHEMA'));
       END IF;Do I need to declare the first column in my insert? which is named seq_id?

  • Popup not INSERTing into table and not refreshing called page ...

    Greetings
    Environment: APEX 3.1.1.00.09 on AIX 5.3 in 10gR2
    I have read many of the threads concerning my issue and I feel I am getting close to the answer but somehow have combined too many of the suggestions and am tripping over my own code.
    Please look at my sample application on apex.oracle.com:
    Workspace: galway
    User: gwicke
    Password: gwicke
    Please start with Page3, select any Agency and then click 'Add New Contract'.
    There is currently a <strong>BOLD </strong>label 'Add New Builder' that is a link that should open a popup window. Type any name into the field and click 'Create Builder'. This should INSERT the row into the builder table, close the popup, assign the new builder name to the calling page item 'Builder Name' and populate the screen item.
    In it's current state, the application will open the popup window, allow entry and close upon clicking the 'Create Builder' button. However the new builder is NOT inserted into the table and the calling page item is not populated.
    By looking at the Page Items and Session State I can see the correct values assigned to the 'Pn_BULDER_NAME' items on both the popup page (4) and the calling page (2) but the value does not appear on the screen.
    I've read where there's really two parallel universes, no sorry, two versions of the screen items, one in Session State and one that is displayed in the browser and there are steps to take to be sure the one displayed is updated from Session State as I would like in this case.
    I've entered Javascript code in the Page4 - header to define the 'passBack2()' function and code in the 'Optional URL Redirect' section of the 'Add Builder' button to hopefully execute the ARP for the INSERT, assign the Page2 items and close the popup. It doesn't quite get all that done.
    Any helpp is greatly appreciated. Thanks to Denes for most of the code suggestions I've followed.
    -gary

    Hi Gary,
    I think that there's a very simple solution to this - didn't really spot it last night.
    Firstly, yes, you could use a "button" to handle the call for the popup - just make sure that the button is a URL type "button" that is actually an A tag with the call in the URL target setting. Alternatively, you could take you existing A tag and use the same class attribute for one of your buttons as this should make it look like a button.
    More importantly, though, I think that we could do it as:
    1 - On your page 2 popup call, clear that cache for page 4 (the popup page) - I have already done this in your app by updating the url
    2 - On the popup page, allow the user to enter in their desired P4_BUILDER_NAME value (not sure if you want to do something to make this unique?)
    3 - Let the user click the Create button on the popup. This will submit the page, which will get your P4_BUILDER_RANK (the pk) value and insert a new record into the table (you could consider creating a sequence and a trigger to handle the creation of a new PK value?).
    4 - Assuming the P4_BUILDER_RANK then exists (it wouldn't if there was an error somewhere), then conditionally display a region that had a piece of javascript that submits page 2 and then closes itself - we don't need to pass anything back to page 2 (see below)
    5 - As the P4_BUILDER_NAME and P4_BUILDER_RANK exist in the session, when page 2 is being reloaded, (A) the select list would be updated with the new Builder (still not sure why all my entries appeared at the bottom instead of in alpha order??) and (B) both P2_BUILDER_NAME and P2_BUILDER_RANK can have Post Calculation Computations set (NVL(:P4_BUILDER_NAME,:P2_BUILDER_NAME) and NVL(:P4_BUILDER_RANK, :P2_BUILDER_RANK) respectively) - the effect of this is, if there are values stored in the P4 page items, we use them, otherwise we use whatever values were in the P2 page items
    6 - Finally, to stop (5) happening in all page 2 loads, you would need to clear the cache for page 4 in as many places as possible - eg, branches to page 2 or buttons on page 2
    The reason we can't pass values back to page 2 is that one of the items is a select list. The value we want to select won't appear on the select list until the page has been submitted. So, we can't set the value and submit because the value isn't there. We can't submit and set the value because javascript wouldn't know when the page has been updated (or, at least, you would have to put some independant mechanism in place to identify this, which may become complicated).
    So, simply put, as long as we know that if the values are in the session, we can use Post Calculation Computations to set our fields to these values. The only thing to bear in mind is that we need to ensure that these session values only exist when we need them - hence clearing the cache. This principle should work for any type of field - but, as you have no doubt seen, simple text fields can be updated by the popup directly as the field should accept any value we give it.
    My only other recommendation would be to completely remove the MRU processes from the page as these are not required (they just confuse the issue) and you could make your PK fetch and record insert into a single process - just to keep things neat and tidy, you understand!
    When I finished with your app last night, I did leave it so that javascript would create a new option on the select list and then set the value. But the above methodology seems to be a lot simpler.
    Andy

  • Auto increment sequence problem

    Hi,
    Is there any particular thing about 21st record because, when i insert data into same or different table, records start from 21 instead of 1 or where it was finished before.
    Example : I leave a table with 3 records. Come back, I insert data into same table then, auto increment starts from 21 not the 4!!!
    Thanks
    CREATE SEQUENCE FRANC_AUTOINC_SEQ
    START WITH 1
    INCREMENT BY 1
    NOMAXVALUE;
    CREATE TRIGGER FRANC_AUTOINC_TRG
    BEFORE INSERT ON FRANCHISE
    FOR EACH ROW
    BEGIN
    SELECT FRANC_AUTOINC_SEQ.NEXTVAL INTO :NEW.FRANCHISEID FROM DUAL;
    END;

    Hi,
    There's no need to do anything.
    If you want fewer numbers to be discarded in the future, you can make the cache size smaller, or remove it entirely, as in:
    CREATE SEQUENCE FRANC_AUTOINC_SEQ
    START WITH 1
    INCREMENT BY 1
    NOMAXVALUE
    NOCACHE;This may mean slightly less efficiency, since (to use my earlier analogy) you have to go to the number store and buy a new box every time you need a number, rather than going to the store once and not having to go back again until you've used up the box of twenty numbers. If you rarely use more than one new number in a session, the loss in efficiency will be insignificant.
    Regardless of the caching, if only one session is using the sequence, you will get consecutive numbers in that session. If NOCACHE is in effect, and you are the only person using the sequence, you will get consecutive numbers even if work over multiple sessions.
    Ending the session is what causes the cached numbrs to be discarded. Shutting down the database implies ending all sessions, but otherwise has nothing to do with the sequence.
    Message was edited by:
    Frank Kulash

  • HSQL DB Identity & Auto Increment

    We are trying to write records to this table:
    create table location_groups
    group_id identity
    ,jdoversion integer
    ,jdoclass varchar(255) default 'path.impl.LocationGroup' not null
    ,group_name varchar(100) not null
    ,group_parent_id integer
    Package.jdo is:
    <package name="path">
    <class name="LocationComponent">
    </class>
    </package>
    <package name="path.impl">
    <class name="LocationGroup" persistence-capable-superclass="path.LocationComponent">
    <!--<extension vendor-name="kodo" key="jdbc-field-map" value="one-one"/>-->
    <extension vendor-name="kodo" key="jdbc-auto-increment" value="true"/>
    <field name="children" persistence-modifier="persistent" default-fetch-group="true">
    <collection element-type="path.impl.Location"/>
    </field>
    </class>
    and package.mapping is:
    <package name="path">
    <class name="LocationComponent">
    <jdbc-class-map type="horizontal"/>
    </class>
    </package>
    <package name="path.impl">
    <class name="LocationGroup">
    <jdbc-class-map type="base" pk-column="GROUP_ID" table="LOCATION_GROUPS"/>
    <jdbc-version-ind type="version-number" column="JDOVERSION"/>
    <jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
    <field name="path.LocationComponent.name">
    <jdbc-field-map type="value" column="GROUP_NAME"/>
    </field>
    <field name="children">
    <jdbc-field-map type="one-many" table="LOCATIONS" ref-column.GROUP_ID="GROUP_PARENT_ID"/>
    </field>
    </class>
    </package>
    I have tried all manner of configurations but the error remains the same:
    25-Apr-2008 16:05:24 com.ea.albt.infrastructure.persistence.jdo.JDODataStore BeginTransaction
    CONFIG: Starting transaction
    25-Apr-2008 16:05:24 com.ea.albt.infrastructure.persistence.jdo.JDODataStore updateObjects
    FINE: Updating object ALBT Loc1209135924484 (has not yet been persisted)
    25-Apr-2008 16:05:25 com.ea.albt.infrastructure.persistence.jdo.JDODataStore updateObjects
    WARNING: Failed to persist/update objectALBT Loc1209135924484
    kodo.util.FatalDataStoreException: Attempt to update the sequence table "JDO_SEQUENCE" failed. The sequence table is typically created when you run the mappingtool's refresh action on any datastore identity class. If you have not run the mappingtool but want to create the sequence table, run:
    java kodo.jdbc.schema.DBSequenceFactory -action add
    NestedThrowables:
    Why is Kodo trying to use the jdo_sequence table when we want it to use the HSQLdb identity field ?

    We have many users using single field identity and auto-increment together.

Maybe you are looking for

  • HP Deskjet F4480 Unable to Scan in 10.6

    After updating to 10.6, my Deskjet F4480 can no longer be used as a scanner. I have tried re-installing the full driver and software provided by HP, which claims to include updated support for 10.6; when I then try to use HP Scan, it tells me no scan

  • GETTING ERROR WHILE INSTALLING ECC6.0

    HI I am trying to install ecc6.0 in window2003 database is oracle10g  it was fine till database creation, when it reached to IMPORT ABAP  phase it started giving error. I got the error at the beggning of the phase i checked the logs a come to know th

  • PLSQL Code for Substracting / Reducing Quantity

    Hi All I have two tables Cash and Product. Cash table has cash related sales in it. Product has product information in it. End user selects the products and specifying their quantity in cash form then saves it. The quantity must be reduced or deducte

  • Why is Photoshop Elements 8 crashing?

    I have been using Photoshop Elements 8 for several years. A few days ago it started crashing. I deleted the program and reloaded it, as I have before, but it keeps crashing every few minutes. What is the problem.?

  • Add a scipt node

    Hi all, I am new to Labview and I want to ask how to add a script node (Matlab script) to a VI, since I can not find it in the function palette. Is that because it is not in base package? Do I need to install other packages? Thank you, Hannah