Re: adding orders from an external source

Originally Posted by
coder1
greetings,
we'd like to write a php script to import orders directly into our miva database.
as i understand it, miva has its own particular way of handling order and order item creation, relying on a table of index values [s01_StoreKeys] to keep track of index maxima which it then increments manually, rather than having the dbm handle this automatically via auto-increment keys. if we want to add orders via a batch import program, to ensure against index number collisions and data conflicts, would incrementing the appropriate maxima in s01_StoreKeys be enough, or would the solution be more complicated than that? the idea is-
lock the s01_StoreKeys table
read the appropriate maxima
update the maxima incremented accorded to the data imported for the batch
unlock the table
- would this approach work, or is it too naïve?
- does anyone know where i can find an annotated data dictionary of some sort to the keys in the s01_StoreKeys table?
thanks
Hi there,
First off, this approach is incredibly prone to issues and there are much better ways to solve this. I guess the first important question to ask is: "where are the outside orders being created, and why not use the 'manage orders' region to create the orders?"
Also, please provide a little background on the order management / ERP you are using. I'll do my best to point you in the right direction!
Thank you much,
-Philip
Philip Hansen
Operations Manager - Professional Services
phansen@mivamerchant.com