Thanks for your lengthy responses everyone. I ended up using sequences
which are available with PEAR MDB2 and DB, so i get the currentID + 1
while inserting, but as you say another entry could have gone in during
the process, but this happens during the insert stage. I might have to
revert the
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] writes:
> Dan Rossi <[EMAIL PROTECTED]> wrote on 04/20/2005 12:55:45 AM:
>> Hi there, I was wondering how its possible to get the MAX of a primary
>> key of a table during an insert. I basically want to create a ticket
>> number, but use the prim
Michael Stassen wrote:
(correcting myself)
I'm guessing that the prefix ('FAULT' in this case) varies according to
the kind of incident, so you want to include it in your table. The best
way to do that is to use a separate column (perhaps an ENUM column with
the possible values). For example,
Dan Rossi wrote:
Hi there, I was wondering how its possible to get the MAX of a primary
key of a table during an insert. I basically want to create a ticket
number, but use the primary key as part of the ticket number ie
FAULT-001 or FAULT-0002 . I tried during a sub query on an
insert
Dan Rossi <[EMAIL PROTECTED]> wrote on 04/20/2005 12:55:45 AM:
> Hi there, I was wondering how its possible to get the MAX of a primary
> key of a table during an insert. I basically want to create a ticket
> number, but use the primary key as part of the ticket number ie
> FAULT-001 or FAU