Bruce,
MySQL seems like a problem for these stored procedures.
So we are trying MariaDB but there is no BAS_IDGEN. There is a Bas_idgen_seq but its empty other than a min, max and a few other values. There seems to be one in every bsv.
We are trying to insert records and with Mysql, the idgen_seq did not update. Also, we are concerned with multiple tenants and hundreds of users, plus some users Adding manually through AIM, the timing of the update of the idgen. So a 'batch' insert could be taking place as well as users entering into the same file.
MariaDB with sequences seems to handle that but it's beyond my expertise.
Are we speaking something like this:
INSERT INTO Observation (Id, Place, BirdId) VALUES (NEXT VALUE FOR Seq1_1, 'Helsinki', 10);
INSERT INTO Observation (Id, Place, BirdId) VALUES (NEXT VALUE FOR Seq1_1, 'Espoo', 10);
INSERT INTO Observation (Id, Place, BirdId) VALUES (NEXT VALUE FOR Seq1_1, 'Kirkkonummi', 10);
INSERT INTO Observation (Id, Place, BirdId) VALUES (NEXT VALUE FOR Seq1_1, 'Hanko', 10);
One last thing. I was able to use the same ID if multiple tables and did not seem to get a crash but Vlad says they must be unique.
In summary, I need to insert records and make sure the sequences continue to bump up and 'Do I not have to update the Bas_IdGe'n because it doesn't seem to display in MariaBD, and maybe it's handled behind the scenes in the db.
Lastly, it has to be bulletproof as its a multi-tenant app with expected hundreds or thousands of users.
Is this making sense:
1 . Create sequence file
- Just use the type of statements above to get unique ids
- Is this going to keep incrementing the bas-idgen...somewhere.
I'm an AIM and Magic programmer, so stored procedures, sql statements, its not my expertise. Any help is appreciated.
Mark F