My (macro, EEP) understanding is that if two users execute the command:

> SELECT (MAX(ColumnName)+1) INTO vMaxNo INDIC IvMaxNo FROM TableName

at the same time, then they will both insert the same value with the next
command:

> UPDATE TableName SET ColumnName = .vMaxNo WHERE COUNT = INSERT

Except if triggers are part of the insert command:
The INSERT command is not 'finished' unless the trigger is executed.
So the order of facts IS:
INSERT of user1, AFTER TRIGGER of user1
INSERT of user2, AFTER TRIGGER of user2

and NOT possible:
INSERT of user1, INSERT of user2, AFTER TRIGGER of user1, AFTER TRIGGER of
user2

Is it so?
TIA

Polychronis T. Kontos
Athens, Greece

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of A. Razzak Memon
> Sent: Friday, November 22, 2002 6:28 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Auto Number - Razzak's Reply
>
>
>
> At 10:37 AM 11/19/2002 -0500, Steve Johnson wrote:
>
> >I am sure there is a better way to control autonumber more
> >effectively.  And I want to minimize the additional keystrokes
> >needed on a repetitive basis to prevent instances of an
> >unwanted incremented autonumber column. Suggestions?
>
>
> Steve,
>
> Ask and you shall receive.  No worries, mate!
>
> Using The Glorious R:BASE 2000 (ver 6.5++), In-Line Patch-3,
> Build:1.854xRT03
> and higher, you can take advantage of the NEW feature of "AFTER TRIGGERS"
> to update the column after the actual INSERT has occurred.  Then, use the
> simple
> scenario as following:
>
> SET VAR vMaxNo INTEGER = 0
>
> SELECT (MAX(ColumnName)+1) INTO vMaxNo INDIC IvMaxNo FROM TableName
>
> UPDATE TableName SET ColumnName = .vMaxNo WHERE COUNT = INSERT
>
> Background:
>
> The current triggers are All "BEFORE" triggers in that they run just
> before the actual INSERT, UPDATE, or DELETE and give you the ability
> to abort the action. The new triggers are "AFTER" triggers in that
> they run just after the action.
>
> The new triggers can be created by the create table command or by
> the alter table command. When you use the alter table command you
> must define the insert triggers in the same command. The same goes
> for update and delete. Do not use one alter table command to add
> the "BEFORE" insert trigger and then another alter table to add the
> "AFTER" trigger. Do them both in the same command. When you drop a
> trigger, you do not specify the "BEFORE" or "AFTER" trigger. The
> drop of the insert trigger, for example, drops both parts of they
> are there.
>
> LIST TRIGGERS and UNLOAD command has also been updated to include
> these changes.
>
> Should you need further assistance or step-by-step instructions, feel
> free to contact me privately at mailto:[EMAIL PROTECTED]
>
> If you would like to test the latest and greatest in-line patch-3 beta,
> send your request to: mailto:[EMAIL PROTECTED]
>
> Enjoy the benefits of staying CURRENT!
>
> Very Best Regards,
>
> Razzak.
>
>
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
>

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to