PDA

View Full Version : Auto Increment field


ABC123

mgw1138
07-19-2010, 12:19 AM
I want to develop a database application that will use extensive use of auto-increment for a unique portion of each tables primary key. I want to use linked fields to a SQLServer database on the desk PC and Oracle Express on my laptop. How does the Auto-Increment field rule connect to the Oracle database? Oracle does not have an "identity" clause in the create table statement similar to SQLServer. Oracle implements this with a separate sequence structure. I just got Oracle installed and thought that I should ask this before I spend a lot of time trying to use Oracle. If the field rule builds its own sequence structure behind the scene I do not want to double the overhead by creating my own. On the other hand I do not want the absence of a sequence structure to cause a cryptic error message that may not point to this absence.

Thanks

Steve Wood
07-19-2010, 03:54 AM
You might read this article: http://wiki.alphasoftware.com/How+to+use+Oracle+Sequences

I just finished implementing some code using LastInsertedIdentity(), but I think a method for Oracle would differ because they use this sequencing method. http://wiki.alphasoftware.com/SQL+Connection+LastInsertedIdentity+Function