[cvsnt] Re: Repository auditing with Oracle

Bo Berglund bo.berglund at telia.com
Tue Jan 10 07:21:42 GMT 2006


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


On Tue, 10 Jan 2006 07:39:41 +0100, Olaf Groeger <Olaf.Groeger at gmx.de>
wrote:

>> The identity columns are always called ID - a habit I picked up years
>> ago and don't plan on breaking in the future - so you could use the
>> column name reliably in the code to identify them.   The trick is
>> getting the correct one after the insert (since on a busy server many
>> clients may be creating rows at the same time).
>
>No, the trick is to ask the database for an ID and use this ID for the
>insert. The autoincrement feature of some DBs is only a convenient for
>this, but performs the same internally. No matter how many clients are
>connected, the database guarantees that a sequence-generated ID is valid.

Out of curiosity as a non-Oracle dB programmer:
Is there an Oracle function that returns a unique ID that will never
repeat, but does so without inserting anything into any tables?

That would serve as a good start for handling cross-table indexing
where the same value must be inserted into the ID columns in all
tables.

But what would happen if an insert is done into a table that is
supposed to be the base of such an index ID and the insert does not
provide the unique ID value? Will it fail?
And what about some insert into that table using a randomly generated
value that was not created by a call to the Oracle function? Will it
be accepted since it does not break any rules? In that case there will
be a later valid insert that is discarded due to a duplicate ID....

But then again I probably do not understand the workings of Oracle
databases...


/Bo
(Bo Berglund, developer in Sweden)



More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook