Michael please eliminate the steps I think are happening just dealing with the jobs table.
1. insert job row 2. get pkyey back 3. update masterKeyValues table
I see 3 separate sql statements involving the first table. Every time you need reference to a PKey you require 200% more code and that is in need of a refactor.
All I was suggesting is that your insert statement returns the bloody key in step one and you move onto inserting items in the same way. Sure you can iterate through all of the sub family per item one at a time before you insert the second item.
On Fri, Mar 25, 2016 at 2:13 PM, < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
Like GWB said, you must be using that "fuzzy math." lol
I count many more than 2 tables: Jobs, Items (child to Jobs), Subitems (child to items), Materials (child to Items), Labor (child to Items), Installation (child to Items), etc. depending how many things deep you do.
On 2016-03-24 16:42, Stephen Russell wrote:
Jane you ignorant slut.
So in reality you have code to generate your first insert + catch new key value. More code to setup next insert(s) using that first Pkey value.
This is Four trips to the db for only single inserts to two tables and then update the master last_id data as well. Now add two more trips for each and every trip for each additional detail rows needed to be added.
Bwahahahaha
On Thu, Mar 24, 2016 at 3:17 PM, < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
On 2016-03-24 14:17, Stephen Russell wrote:
You control freak. Let the backend do what it does so well.
https://mariadb.com/kb/en/mariadb/auto_increment-faq/
I gave up on that single table of last PKs 15 + years ago when I found that the backend already did it for us, all we had to was ask for it.
From SNL: "Jane, you ignorant slut." lol
Steve -- you might recall the original post from this thread that laid out that there were multiple levels (3+) that were needing keys at record creation time, so the AUTOINC on the backend was not an option as we were creating datasets locally and then if the user saved, we committed to the database. So your "let the backend do it" doesn't apply here.
[excessive quoting removed by server]