How do I change large amounts of table data.

games4fungames4fun Member Posts: 185
edited July 2012 in Working with GS (Mac)
Hello all,

What I want to is have a interger attribute that dependning on what number is it to have all the rows greater than the number move up one slot from a table. For example

I have 5 inventory slots

Each slot is referenced by a table row but it you remove item 2 from your inventory I want all the other rows greater than 2 to move from there row to there row -1. So it fills in the empty spot. Hope that makes sense.

I dont want to delete rows asI will reuse them.

Thanks

Answers

  • ORBZORBZ Member Posts: 1,304
    that's probably not a good idea. Generally speaking when working with datasets you want to keep them in place as it's less CPU intensive. Just mark it as deleted with a boolean column "is_deleted"
  • games4fungames4fun Member Posts: 185
    The only thing with that is I have the rules set to reference specific rows. If I use the delete row would it move the other rows up one then?
  • HC_DKHC_DK Member Posts: 92
    @games4fun: Yes, it will move up.
    Do as @ORBZ said then you can keep your order.

    HC
  • KodeRiter722KodeRiter722 Member Posts: 42
    Honestly, if you are referencing specific rows, then just make enough rows for every item in your game and add/remove items in the row that matches their integer attribute. Don't bother removing rows. It doesn't provide any benefit.
Sign In or Register to comment.