in reply to Re^6: Increment DB using Perl
in thread Increment DB using Perl

Now you've really lost me. Which rows do you want to update? What should the XXX in this be?: UPDATE request SET ID=$newid WHERE XXX

Replies are listed 'Best First'.
Re^8: Increment DB using Perl
by Anonymous Monk on Mar 08, 2005 at 17:01 UTC
    ID is the name of the row to be updated and variable $newid should be the new id number to be inserted into the database table, so every time in the while loop the first row should be inserted with a 0 and all the rest of the rows should get incremented values 1 for the second row 2 for the third row until the end of the rows on the table.
      > ID is the name of the row

      No, it is the name of a column which identifies the row. So you want something like

      UPDATE request SET ID=$newid WHERE ID = XXX

      Again, you haven't told us enough information to know what XXX is.
        Sorry, there isn't any XXX value the code that I have that does the update is the one here
        $sql2 = "UPDATE request SET ID='$new_id'";

        And no primary key