Although I am using primary keys for the relationship between two tables, exam and exam pictures,
I take a copy of the database (no records) out of the studio to a clients where I carry out examinations add pictures
to the reports. (some locations do not have 4G or wifi).
When getting back to the studio I run this script as attached which exports the two tables exam and exam pictures from the offline exam file. Then imports them into the exam on the server.
All the reports and pictures come through perfectly.
As I am using primary keys for the relationship , I wanted the records to have a smaller number that the client sees.
So after the reports where imported and before the second table is imported I add a loop to add the serial number to the imported records.
This part is not working as instead of adding exam03527 to the first of the imported records it adds exam03557
I was adding 6 records not 31 records.
If I import 4 records it jumps by 13 records
I am using the loop incorrectly?