Updating the SQL key value
- From: bill <nobody@xxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 09:50:00 -0400
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key.
(there are in the range of 20 steps)
On the admin page the steps are listed, in "order" order and the user can create new steps and assign an order and all is well.
The problem may come in using a renumber function which should take the steps in their current order and reassign the "order" key, assigning each set an "order" that is the prior "order" + 10.
In other databases I have worked with this is a major pain because as soon as you save a record the order may change.
OTOH, in mysql it appears that if you do a select for the whole table you have them all in memory and can change the value of the field "order" without having to worry about getting that record again and then save the whole table.
Is that correct ?
bill
.
- Follow-Ups:
- Re: Updating the SQL key value
- From: Drazen Gemic
- Re: Updating the SQL key value
- From: Toby A Inkster
- Re: Updating the SQL key value
- From: Jerry Stuckle
- Re: Updating the SQL key value
- From: Erwin Moller
- Re: Updating the SQL key value
- Prev by Date: Re: Regex problem
- Next by Date: Re: ipcam to stream?
- Previous by thread: dba_open undefined
- Next by thread: Re: Updating the SQL key value
- Index(es):
Relevant Pages
|