Coping one to many records into another one to many records

Hi,
here are the screenshots of the db...
an example would be the row (s) with 'orderno' = 6558
 

Attachments

  • A_PK.jpg
    A_PK.jpg
    194.2 KB · Views: 26
  • A_PK_rows.jpg
    A_PK_rows.jpg
    318 KB · Views: 23
  • B_PKFK.jpg
    B_PKFK.jpg
    225.6 KB · Views: 20
  • B_PKFK_rows.jpg
    B_PKFK_rows.jpg
    200.1 KB · Views: 21
Well, no "orderID" anywhere, so not sure what columns/fields you've always been referring to.
Seems in whatever "original" software has created and is working with these tables, it doesn't look as if you could even (list-)join them in Fabrik, because your tables seem to "originally" be joined via the "orderno" columns in both tables. Neither of them is a PK, but Fabrik needs one leg of a join to be a PK, as said before and per Wiki.

Even if it were the case and a Fabrik list join would work well (because you worked your way around it as described previously), now it's also clear that the "copy list" plugin would be unable to do the job, because it'd be unable to generate the "orderno" in either table.
The PHP list plugin could do so with the right code, but we don't know how the "orderno" is generated in the "original" software, so at this point it'd be a guessing game to replicate this in Fabrik... you say it's "+1", but it could be right or completely wrong, and if wrong, the original software might fail.

So, if you must work with these tables in both the "original" software and Fabrik, you'll have more work to do... add a FK in table B to make the list join work in Fabrik, finding out what sets "orderno", then writing several lines of code in the Fabrik PHP list plugin to generate a proper "orderno" and inserting proper row copies into the DB tables.
 
Hello,
yes, I got confused with the names, it's not 'orderId' but 'orderno', which binds both tables. I think the increment of 'orderno' is sequential, of units, at least looking at the data. Probably the PHP LIST plug-in could do for me. I have to see it and understand how to use it in this situation.
Thank you :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top