An example. Let’s say you have a form with one field for a company name, one for company address, one for city, one for state, one for zip - but you could have anywhere from 1 to 5 fields for some kind of federal ID number.
You insert the company information (without the federal ID) into one table (tableA), then you have another table for the federal ID that is associated with the server-generated UUID of the company that was just inserted (tableB).
tableA
companyUUID companyName address city st zip
1234-asdf Acme LLC 123 Main St Yourtown MN 65432
tableB
federal_id_uuid companyUUID federalID
4567-erty 1234-asdf 676767
4567-poiu 1234-asdf 454545
4578-yhng 1234-asdf 232323
A chained query would be something like:
{connect to database with credentials}
INSERT into tableB(federal_id_uuid, companyUUID, federalID)
VALUES(sysguid(), '1234-asdf', '676767');
INSERT into tableB(federal_id_uuid, companyUUID, federalID)
VALUES(sysguid(), '1234-asdf', '454545');
INSERT into tableB(federal_id_uuid, companyUUID, federalID)
VALUES(sysguid(), '1234-asdf', '232323');
{disconnect from database}
The semi-colons separate each individual query but it’s all done in one connection. Versus a looped query which would be:
{connect to database with credentials}
INSERT into tableB(federal_id_uuid, companyUUID, federalID)
VALUES(sysguid(), '1234-asdf', '676767')
{disconnect from database}
{connect to database with credentials}
INSERT into tableB(federal_id_uuid, companyUUID, federalID)
VALUES(sysguid(), '1234-asdf', '454545')
{disconnect from database}
{connect to database with credentials}
INSERT into tableB(federal_id_uuid, companyUUID, federalID)
VALUES(sysguid(), '1234-asdf', '232323')
{disconnect from database}
V/r,