Single Field Identity & Auto-Increment

I was wondering if I could use single field identity and auto-increment
together? I've tried it, my code compiles and enhances ok, but it throws
and exception when I tried to run a unit test.

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

Similar Messages

  • 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.

  • How do I change an INT field to IDENTITY auto-increment by 1 Starting at 30000?

    I have a SQL table with data already in it, and an INT field called fldPeopleID.  I can change it manually to IDENTITY seed (30000,1) but I want to do it using code.  I tried the wording
    ALTER TABLE [PicSmartMaintenanceDB].[dbo].[tblPeople2] ALTER fldPeopleID INT IDENTITY ( 30001,1 ) NOT FOR REPLICATION
    but I get the error:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'IDENTITY'.
    Can someone tell me the proper syntax to use?  Thanks!
    Jim Fuchs, Davenport, IA

    I can change it manually to IDENTITY seed (30000,1) but I want to do it using code
    Hello Jim,
    When you do it in SSMS Designer then have a look at the generated script: The table will be renamed, a new table with identity will be created, the data copied and the old table dropped.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Creating auto increment custom metadata field in UCM

    Hello,
    Can anyone tell how to create a metadata Integer field with Auto Increment option?
    Also while creating users, I have a custom Department field. I want this field to be displayed in my profile. How can i achieve this?
    Richa

    SHort of paying someone else to do the work for you I am afraid there is no shortcut.
    However writing a component need not be difficult or complex if you take a sensible approach.
    There are some excellent blogs out there, at least one comprehensive book and even the documentation will get you started
    http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/documentation/developer/sdk_getting_started_10en.pdf
    I recommend you get Bex's book and you should be able to get a new component like this up and running in a day or two.
    Tim

  • The great SQL ColdFusion Auto Increment fiasco

    Hello all and thanks in advance for your help. I am
    working on an Insert Record page using ColdFusion 7, Dreamweaver 8
    and SQL Server 2000.
    The SQL DB has a table called Articles. The table Articles
    has a Primary Key field called ArticleID which is set to a type of
    "Numeric, Identity:Yes, Seed:1, Increment:1" and no Null allowed.
    I am getting an error message of:
    Variable
    PAGENUM_RSARTICLES is undefined.
    The error occurred in
    D:\Inetpub\guardyourself\backend\article_add.cfm: line 107
    105 : </cfquery>
    106 : <cfset MaxRows_rsArticles=10>
    107 : <cfset
    StartRow_rsArticles=Min((PageNum_rsArticles-1)*MaxRows_rsArticles+1,Max(rsArticles.Record Count,1))>
    So. How do I get the ArticleID field on the CF page to see
    what the last SQL row shows for an ArticleID... and then add one?
    I'm stumped. Any help you can provide would be greatly appreciated.
    Code for the page in question is as follows or you can just go to :
    http://www.guardyourself.org/backend/article_add.cfm

    I think there may be a little confusion about what a
    uniqueidentifier field type is. You're talking about two separate
    concepts as though they are one. To create a field which
    "auto-increments" in SQL Server, you need to create the field as a
    numeric type and then specify that the field is an identity field
    (you can also specify the start and increment values). On insert,
    SQL Server will assign values to this field based on the criteria
    you supplied. If you do this, you will typically want to omit the
    value and field from your ColdFusion inserts as you have described
    below.
    What you have done instead is to create the field as a
    uniqueidentifier which requires a GUID value to be stored there.
    You cannot "increment" a GUID. The GUID for new records must either
    be generated by SQL Server (using the newID() function) or
    externally in your code. You must pass this value on insert from
    ColdFusion.
    Hope this helps.
    Adam

  • Primary key column auto increment

    Hello,
    In my Azure SQL Database I noticed that weird thing is happening. I have table with primary key column with auto increment, and all works fine, on new insert that value automatically increment, but every now and then, that value, for no reason, increments
    for 1000.
    For instance i have in DB values in this order: 1, 2, 3, 4, 1001, 1002, 1003, 2004,  2005, 3001, 3002...
    Why is this happening? 

    Hello ,
    you can see this thread :
    http://stackoverflow.com/questions/17012339/windows-azure-sql-database-identity-auto-increment-column-skips-values
    It's seems that SQL Server work with sequence and block 1000 values. In the cloud, your SQL Azure Database can be move from one server to an other or restarted and so a new sequence is used. That's why you jump from 4 to 1001.
    Regards

  • DB Adapter - PostgreSQL - Primary key - auto increment handling

    Hi,
    I have to connect to a PostgreSQL DB. I have a table in which has a primary key called seq_id. This seq_id is being incremented using a sequence.
    I have to configure the DB adapter for this table. The problem is that while creating the adapter it does not allow me to deselect the primary key (seq_id). Because of this I have to supply a value for the seq_id while inseting the data using the adapter. But this defeats the purpose of sequence (auto increment).
    Is there a way to get around this and to avoid specifying the value for seq_id while using the DB Adapter and let it get inserted using the sequence of the DB?
    Thanks,
    Sanjay

    Hello ,
    you can see this thread :
    http://stackoverflow.com/questions/17012339/windows-azure-sql-database-identity-auto-increment-column-skips-values
    It's seems that SQL Server work with sequence and block 1000 values. In the cloud, your SQL Azure Database can be move from one server to an other or restarted and so a new sequence is used. That's why you jump from 4 to 1001.
    Regards

  • Identifying auto-increment columns

    Hi,
    I am developing a database management package for mysql. I want to be able to provide a sql dump facility, which will produce the sql code for creating a table and populating it.
    I do not seem to be able to find a function for identifying if a field is auto-incrementing?
    The only thing that I could find it the DatabaseMetaData.getTypeInfo() will let you know if a field can used for an auto-increment value, not if it is actually auto-incrementing.
    Please help!

    If you do a query of this table and then have a look at
    the ResultSetMetaData you can use the methode:
    boolean isAutoIncrement(int column)
    Indicates whether the designated column is
    automatically numbered, thus read-only.
    Or you can use the MYSQL-command :
    show columns from table to get all the info of each
    column.
    mysql> show columns from table;
    -----------------------------------------------------------------------------+
    | Field | Type | Null | Key | Default | Extra |
    -----------------------------------------------------------------------------+
    where the Extra column contains 'auto_increment ' if it is...
    ...what in fact is not that DB-independent.....
    Regards
    Fredy

  • Utilizing auto-increment/identity fields for primary key with "application" identity

    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?

    To the best of my knowledge, you cannot use auto-increment. Due to the
    differences in the way that identities are generated at the datastore
    (upon insert) vs. JDO (upon makePersistent), this feature of SQLServer is
    not supported yet.
    However, we do provide a variety of other ways of generating identity
    which may provide a closer fit to what you want, and
    our users may have some experience in solving your problem.
    On Tue, 28 Jan 2003 09:56:08 +0000, Sean Ryan wrote:
    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?--
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Auto Increment Not Working - SQL Identity field

    I am new to Visual Basic & SQL server but have some experience in Access & VBA. But this is a steep learning curve!
    I am banging my head against a wall with a problem..
    All of my tables in this database are in the dataset. The main one being tblItems with a PK 'ITEMID'
    I have 2 forms - the first one is used to lookup an item the second displays the item's full details.
    On the first form (lookup) I have a 'Add New' button which launches the second form with the code - frmProductDetail.VItemsBindingSource.AddNew()
    This opens the form with empty boxes as expected. I have a 'Save' button on the second form with the following code -
            Dim row As SASHItemsDataSet.tblItemsRow
            row = SASHItemsDataSet.tblItems.NewRow
            With row
                .ITEMCODE = txtItemCode.Text
                .ITEMDESCRIPTION = txtItemDescription.Text
                .CATEGORY = cmbItemCategory.SelectedValue
                .PURCHCOST = txtPurchCost.Text
                .SELLCOST = txtSellPrice.Text
                .UNIT = cmbUOM.SelectedValue
                .VATID = cmbVAT.SelectedValue
                .WHLOCATION = cmbWHLoc.SelectedValue
            End With
            SASHItemsDataSet.tblItems.Rows.Add()
            Try
                Me.Validate()
                Me.VItemsBindingSource.EndEdit()
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "UPDATE FAILED")
            End Try
    My problem is I get the error msg box with the following error 'Column 'ITEMID' does not allow nulls'
    This field is set as a auto incrementing identity field with all the correct settings shown in Visual Studio so it shouldn't be coming back as null.
    I have Googled for hours & tried all sorts with no luck..
    I have clearly gone wrong somewhere but I can't work out where... any help appreciated!
    James

    This is the code on frmProductLookup that opens the form...
            frmProductDetail.Show()
            frmProductDetail.VItemsBindingSource.AddNew()
    This is the code on frmProductDetail_Load...
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblVAT' table. You can move, or remove it, as needed.
            Me.TblVATTableAdapter.Fill(Me.SASHItemsDataSet.tblVAT)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblWarehouseLocations' table. You can move, or remove it, as needed.
            Me.TblWarehouseLocationsTableAdapter.Fill(Me.SASHItemsDataSet.tblWarehouseLocations)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblStockUnits' table. You can move, or remove it, as needed.
            Me.TblStockUnitsTableAdapter.Fill(Me.SASHItemsDataSet.tblStockUnits)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblItemCategory' table. You can move, or remove it, as needed.
            Me.TblItemCategoryTableAdapter.Fill(Me.SASHItemsDataSet.tblItemCategory)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.vItems' table. You can move, or remove it, as needed.
            'Me.VItemsTableAdapter.Fill(Me.SASHItemsDataSet.vItems)
            Me.VItemsTableAdapter.Fill(Me.SASHItemsDataSet.vItems)
            Me.VItemsBindingSource.Position = Me.VItemsBindingSource.Find("ITEMID", _passedText)
            Me.txtWKSName.Text = Environment.MachineName
            Me.txtSellPrice.Text = FormatCurrency(Me.txtSellPrice.Text)
            Me.txtPurchCost.Text = FormatCurrency(Me.txtPurchCost.Text)
            Me.txtPriceIVAT.Text = FormatCurrency(Me.txtSellPrice.Text + (Me.txtSellPrice.Text * 0.2))
    On the tblItemTableAdapter this is the Command Text for the Insert Command...
    INSERT INTO tblItems
                             (ITEMCODE, ITEMDESCRIPTION, UNIT, WHLOCATION, VATID, PREFSUPPLIER, CATEGORY, PURCHCOST, SELLCOST, INACTIVE)
    VALUES        (@ITEMCODE,@ITEMDESCRIPTION,@UNIT,@WHLOCATION,@VATID,@PREFSUPPLIER,@CATEGORY,@PURCHCOST,@SELLCOST,@INACTIVE)
    SQL Server Management Studio clearly shows the column as an Identity column. If I add a row through SSMS it does create an PK identity automatically. I have also dropped the ITEMID column & recreated through SSMS which has no effect.
    I am now considering creating a separate form just for adding an item but I have managed it in Access but am just struggling with VB!
    Thanks,
    James

  • Integer auto-increment fields

    I am using 3.0.3 and have a PC class that uses application identity and
    MSSQL server, so we are using auto-increment fields for our primary keys.
    In the past (with sequence-generated ids) we have used Integers for our
    mapped attributes, but with the application identity, it seems we need to
    use ints. Is there a reason for this, or is it a bug?
    Nathan

    Great. Thanks for the help.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    This is a bug. I've reported it at:
    http://bugzilla.solarmetric.com/show_bug.cgi?id=910
    I expect it will be fixed in the next release. In the meantime, if you
    want to use a numeric wrapper for your auto-increment field, it will
    need to be of type java.lang.Long.
    In article <[email protected]>, Nathan Voxland wrote:
    It does work with Longs. I could switch my code to use Longs, although
    I
    don't always need that large of an id field.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    If you change them both from Integer to a Long field, then does it
    work?
    >>>
    >>>
    In article <[email protected]>, Nathan Voxland wrote:
    Here is the code for the class and the ApplicationId class. The
    ApplicationId class was generated using the appidtool.
    public class Portfolio {
    private Integer id;
    private String name;
    private String notes;
    private Organization client;
    private Portfolio parentPortfolio;
    private Set subPortfolios;
    private Set projects;
    private Date created;
    private Person createdBy;
    private Date lastModified;
    private Person lastModifiedBy;
    public Portfolio(PersistenceManager pm) {
    pm.makePersistent(this);
    this.subPortfolios = new HashSet();
    this.projects = new HashSet();
    this.created = new Date();
    this.createdBy = new PersonPeer(pm).findLoggedIn();
    this.lastModified = this.created;
    this.lastModifiedBy = this.createdBy;
    public Integer getId() {
    return new id;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public void jdoPostLoad() {
    public void jdoPreStore() {
    if (!((PersistenceCapable) this).jdoIsNew()) {
    this.lastModified = new Date();
    this.lastModifiedBy = new
    PersonPeer(((PersistenceCapable)
    this).jdoGetPersistenceManager()).findLoggedIn();
    public void jdoPreClear() {
    public void jdoPreDelete() {
    * Auto-generated by:
    * kodo.enhance.ApplicationIdTool
    public class PortfolioId
    implements Serializable
    static
    // register persistent class in JVM
    Class c = Portfolio.class;
    public Integer id;
    public PortfolioId ()
    public PortfolioId (String fromString)
    if ("null".equals (fromString))
    id = null;
    else
    id = new Integer (fromString);
    public String toString ()
    return String.valueOf (id);
    public int hashCode ()
    return ((id == null) ? 0 : id.hashCode ());
    public boolean equals (Object obj)
    if (this == obj)
    return true;
    if (!(obj instanceof PortfolioId))
    return false;
    PortfolioId other = (PortfolioId) obj;
    return ((id == null && other.id == null)
    || (id != null && id.equals (other.id)));
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    Is the primary key field an Integer in both the application
    identity
    class and the persistent class itself? They need to both be the same
    class.
    If they are the same, and you are still getting the exception, could
    you post the code for the classes (or else mail them to
    [email protected])?
    In article <[email protected]>, Nathan Voxland
    wrote:
    When I have my object use an int id, my test runs fine, when Iswitch
    to
    an
    Integer, I get the exception:
    kodo.util.FatalException: java.lang.ClassCastException
    NestedThrowables:
    java.lang.ClassCastException
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:563)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(UnknownSource)
    at
    com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
    Source)
    at
    com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
    Source)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Caused by: java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    ... 24 more
    NestedThrowablesStackTrace:
    java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Nathan
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    What behavior are you seeing that is preventing you from using
    Integers?
    -Patrick
    Nathan Voxland wrote:
    I am using 3.0.3 and have a PC class that uses application
    identity
    and
    MSSQL server, so we are using auto-increment fields for our
    primary
    keys.
    In the past (with sequence-generated ids) we have used Integers
    for
    our
    mapped attributes, but with the application identity, it seems
    we
    need
    to
    use ints. Is there a reason for this, or is it a bug?
    Nathan
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Error & Missing explanation in docs regarding Auto Increment / Identity

    Hi Data Modeler-Team, Hi fellow readers,
    could you please explain the meaning of option
    "Column Properties" - "General" - "Identity" (next to "Auto Increment"), as I don't see a logical difference between those two.
    Also, the meaning of these fields is left out in the docs under
    http://docs.oracle.com/cd/E18464_01/doc.30/e15802.pdf "3.8 Column Properties" - "General" (page 75)
    Thanks,
    Blama
    (WinXP, Version 3.0.0.665)
    Edited by: bl**** on 30.12.2011 15:40

    Hi Philip, Hi David,
    thank you for your answers.
    I saw now that "identity" is removed for one column if I assign "identity" to another column and that I can have many auto-increments within one table.
    But what does "identity" mean exactly? I don't see a difference in the displayed relational model and also don't see a difference in the created DDL.
    Isn't "identity" from the meaning the same as a Primary Key?
    Thanks,
    Blama

  • Gets the new id of auto-increment field by jdbc

    There is a auto-increment index field of a table. I would like to add a row in that table by jdbc. The process is success and the index will increase automatically. However i would like to get the newly added index number. How can i do this? Thanks a lot.

    This is off of Microsoft's T-SQL site http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_tsqlcon_6lyk.asp
    @@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope.
    IDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the identity value generated for a specific table in any session and any scope. For more information, see IDENT_CURRENT.

  • Auto-incrementing field?

    I am designing a publication which refers to numbers on a Reader Service Card and am looking for a technique to have these numbers auto-increment.
    Throughout the document, a Text Frame appears that reads "Circle# 10 on the Reader Service Card." This may appear multiple times on a single page, or not at all. I need for the 10 to start at 1 and increment each time we get to it in order.
    I have read several helpful posts relating to similar issues. I could certainly use multiple Text Frames, one with "Circle# on the Reader Service Card." and a smaller one for the number. Thread the smaller ones together and fill them with:
    "1
    2
    3
    4
    5
    6
    This would work, but I would have to re-thread each time the ads are reordered. And I would have to change the spacing on the bottom Text Frame at the point that we go from single-digit to double-digit numbers.
    I also investigated Data Merge, but it seems better suited for single-page documents in which the only thing that changes are the content records. Using the same data source from above, I don't see a way to insert the field throughout a multi-page document and have it go to the next record each time it is encountered.
    I am using CS5. Any suggestions would be appreciated. Thanks.

    I have made some progress by using a script, as suggested: http://forums.adobe.com/message/2366871.
    count = 0;
    str = "";
    while (count < 100)
    count++;
    str += "Circle #"+count+" on reader service card."+"\r";
    app.selection[0].contents = str;
    This script will insert the proper text lines into the selected Text Frame. The subsequent ones still have be manually threaded, but at least each is in a single Text Frame and I don't have to worry about spacing. If numbers change I can go to the first one and re-run the script.
    Now if there were some way to dynamically thread Text Frames...

  • Auto Increment of Primary Field in Table Maintainance

    Hi,
    We want to give an Auto increment to the Primary Key, when ever the table is updated/inserted with a new record. How to get the value updated????
    For Eg,
    Table ZTEST Contains     MANDT, ITEM,   EBELN.
    It should have the values 800    001   000977
    And when the next record is created, the ITEM value should be Automatically get the value 002.. and so on for every Record.
    Pls do let me know if any other details is reqd.
    Thanx in Advance.
    Ajaz

    Dear Syed,
       You can do many things in table maintenance screen like validation of some field, making some field required or displayed etc.
       For auto increment you have to use Number-Ranges. FM NUMBER_GET_NEXT is helpful in this case.
       Where to write the code??? The Function-Group you have made. There will be includes. You can easily locate the place to write these codes.
       Caution point is that if you re-generate the table maintenance then all code will be gone.
    Regards,
    Deva.

Maybe you are looking for

  • How to transfer music from one account to another

    I created a new apple id account and I want to transfer my music from my previous account to my new one. How do I do that?

  • Problem with Essentials.xml in CS6

    I have been working on a project for weeks and now it won't load because Flash CS6 gives me this error: "The following panel or layout is missing or could not be read".  Which is Essentials.xml.  The file is in the directory but it is now blank.  I h

  • Custom Paper Size in Page Setup grayed out and cannot be selected.

    I am playing with the iWork '08 demo and looking at Pages. I need to create an 8.25 x 10.5 custom paper size, which I did, but when I try to select it in Page Setup, it is grayed out. If I open a document made in the previous Pages that was done usin

  • Very large Keynote file size

    One of my Keynote files has grown to 704 MB and now takes forever to save. How can I reduce the size of this file? I suspect some photos in the file are larger in MB size then they need to be. Thanks

  • Can I download software I purchased on DVD?

    Hi, I'm considering purchasing a version of Creative Suite from my campus computer store because they offer a special discount. This would mean that I'd be purchasing a physical DVD copy of the software. I use a MacBook Air and thus am without an opt