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

Just the row "ID", nothing else, just need the code to run and insert numbers starting from 0 to whatever is the last row in the table from the database.

Replies are listed 'Best First'.
Re^7: Increment DB using Perl
by jZed (Prior) on Mar 08, 2005 at 16:58 UTC
    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
      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.