Re: Updating the SQL key value



bill wrote:
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

Bill,

Try asking in comp.databases.mysql. This is a PHP newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: Upsizing
    ... Just had a look and each table does have a primary key. ... "Sylvain Lafontaine" wrote: ... > Queries window. ... >>I have upsized an Access database to an SQL database via the Access ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Q: Datatables, Datasets and updating
    ... I have two tables A and B in the SQL database. ... ID_A (the primary key of A) and NAME_A (a string ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Table relationship
    ... > There may be dozens of lines represented on one bill each month. ... >> If your primary key in Table1 is a 2-field composite key, ... >> Jeff Boyce ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Q: Datatables, Datasets and updating
    ... the automatic updating features of a DataSet and DataAdapter. ... > transfer the data inputted into the SQL database. ... >> The problem seems to be that you have defined Primary Key to mean Identity ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: blank form, cant insert new record
    ... is with a trigger in the SQL database - I know there were some recent ... SQL trigger. ... Any Insert trigger should affect data entry whether it's from the table ... the Primary Key of the table? ...
    (microsoft.public.access.forms)