autogen without sequence [message #210971] |
Sun, 24 December 2006 07:18 |
sispk6
Messages: 164 Registered: November 2006 Location: pakistan
|
Senior Member |
|
|
primary key for all my tables is like(attr1_rowid) and i w ant it to be generated automatically as i insert a new record, but i dont want to use a sequence ??
help thaanx in advance
|
|
|
Re: autogen without sequence [message #210972 is a reply to message #210971] |
Sun, 24 December 2006 07:25 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Too bad for you. Sequences is the way Oracle makes 'autogen' columns.
Why not use it?
Let me guess: database independency...
If it is, you should start to create the independency on a higher level. Create an API for each database you will want to port to, using AS MUCH database-specific stuff AS POSSIBLE.
For example: use sequences in Oracle, use autogen in SQLServer etc.
On top of that API-layer, build a db-independant product.
Believe me, you will NOT regret this.
[Edit: And a sidenote: do not call your column ...rowid. It is confusing, as rowid is something different in Oracle. Call your PK-column ID. It is what everybody else does...]
[Updated on: Sun, 24 December 2006 07:26] Report message to a moderator
|
|
|