List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 25 1999 3:40pm
Subject:Re: using the tablerow id
View as plain text  
At 11:37 AM -0400 6/25/99, mab@stripped wrote:
>I have a table with two columns.
>
>The first is "rowid" and is auto-incremented.
>The second is an int named "id".
>When I do an insert, I only set the "id" field.
>
>But _sometimes_ I would like the "id" field to be
>the same as that which will go into the "rowid"
>field. But I don't know what the rowid will be when
>I do the insert. Is there any way to set id to be
>the same as what the row id will be without doing
>a separate query to find out what the last rowid is?

I believe you'll have to create the row, then update
the id field to LAST_INSERT_ID().

-- 
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/
Thread
using the tablerow idmab25 Jun
  • Re: using the tablerow idPaul DuBois25 Jun
  • Re: using the tablerow idGerald Clark25 Jun
  • Re: using the tablerow idGerald Clark25 Jun