View Single Post

  #5 (permalink)  
Old 02-26-2008
Tim Smith
 
Posts: n/a
Default Re: auto-increment and transient rows during transaction

In article <pg6d95-1cp.ln1@xl.homelinux.org>,
Axel Schwenke <axel.schwenke@gmx.de> wrote:
> > For some new
> > code, there is a situation where I don't have the data that is to be
> > inserted, but I need to know what the ID will be when I get around to
> > inserting it. So, I want to make the auto-increment skip a value, and
> > note that value, so that later I can use that as the ID when I insert
> > the data.

>
> Ugly. Why don't you just insert a dummy row and UPDATE it later with
> the real values? You have to remember the PK of that row anyway.


Same reason as 90% of the other ugly hacks: stupid legacy code that I
don't want to disturb. :-)

--
--Tim Smith
Reply With Quote