In SQL we have an order-header table and an order-lines table.
For our financial software we need to create a formatted csv file wich will have to look like this:
"header","ordernbr","company","adress",etc.
"line","productnbr","Title","quantity","price",etc.
"line","productnbr2","Title2","quantity2","price2",etc.
"header","ordernbr2","company2","adress2",etc.
"line","productnbr","Title","quantity","price",etc.
"line","productnbr2","Title2","quantity2","price2",etc.
So we need to create some sort of a loop that exports the orderheader first and then puts the orderlines from that same order in the next line(s).
In SQL both tables contain the ordernbr, but in our financial software only the orderheader contains this number. Thats why we need the csv file in this format.
I hope someone could give us a hint or at least a little nudge in the right direction.
Thanks in advance for your time and wisdom...
Regards
Rene
For our financial software we need to create a formatted csv file wich will have to look like this:
"header","ordernbr","company","adress",etc.
"line","productnbr","Title","quantity","price",etc.
"line","productnbr2","Title2","quantity2","price2",etc.
"header","ordernbr2","company2","adress2",etc.
"line","productnbr","Title","quantity","price",etc.
"line","productnbr2","Title2","quantity2","price2",etc.
So we need to create some sort of a loop that exports the orderheader first and then puts the orderlines from that same order in the next line(s).
In SQL both tables contain the ordernbr, but in our financial software only the orderheader contains this number. Thats why we need the csv file in this format.
I hope someone could give us a hint or at least a little nudge in the right direction.
Thanks in advance for your time and wisdom...
Regards
Rene