Hi Martin
Thanks for the reply, i’m happy to share the WF if that would help… ill try not to take up 2 much space in this message…
my source file comes from Shopify, it’s a CSV file where each line is a product, 6 products in total so a max 6 entries for any one order. the first record of each order holds the name, address etc and product 1, following entries just have the order no & product. I am manually loading this into mySQL and this is the starting point for PP.
im still writing it, currently, its started by a trigger file (empty text file)
as you can see, all the database work is done using "database query " objects.
no4 query = call database.loadprocess();
loadprocess in my sql looks like :
update start set gcode = randString(16) where pk > 0 and isnull(status);
update start set gcode = concat_WS(“-”,trim(gcode),pk) where pk > 0 and isnull(status);
update start set loaddate = curdate() where pk > 0 and isnull(status);
INSERT INTO client
.mhmaster
(Name
,Email
,Shipping Name
,Shipping Street
,Shipping Address1
,Shipping Address2
,Shipping Company
,Shipping City
,
Shipping Zip
,Shipping Province
,Shipping Country
,Shipping Phone
,PK
,gcode
,deliverymethod
,status
,working
,loaddate
)
select Name
,Email
,Shipping Name
,Shipping Street
,Shipping Address1
,Shipping Address2
,Shipping Company
,Shipping City
,
Shipping Zip
,Shipping Province
,Shipping Country
,Shipping Phone
,PK
,gcode
,deliverymethod
,status
,working
,loaddate
from start
where pk in (select min(pk) from client.start group by Name) and isnull(start.status);
insert into mhorder select * from start where isnull(start.status);
update start set start.status = 1 where pk > 0 and isnull(status);
update start set start.working = 0 where pk > 0 ;
call client.updatepacksize();
so 4 just runs queries and a couple of function calls
8 = simple select command, the result is a csv file used by 12 & 13 (paf cleans the data)
16 truncates a table ready for new data
17 captures the clean data from 13
18 - 21 runs through the clean data inserting into a table
25 normal select query
27, based on what, how many and how large the pack will be picks between Courier, NZ Post, DX
after all this, 29 selects data from the main table into 4 tables, courier,NZP,DX and a email file where we plan to email the receipent and direct them to a web page to update their address
the last part you cant see just creates a trigger file to kick off process 2
Process 2:
pretty much 4 x this, the query is simply
select * from client
.nzp
;
I split it here as the second part just grabs the data in the 4 tables and saves them as CSV files, when run, I am the NZP file missing. As I can drop the second trigger file again (it just grabs data from mySQL) when I do, I get all the files im expecting (i can do this till im blue in the face, correct ererytime, its just the first time that it doesnt work)
I’m still working on it… As I said, it’s correct every time in debug, just fails in production (unless i run it twice)
any help would be appreciated
thanks, Richard