begin_download
The begin_download script for CustDB is as follows:
CALL ULOrderIDPool_maintain( {ml s.username} )
The ULOrderIDPool_maintain procedure for CustDB is as follows:
ALTER PROCEDURE ULOrderIDPool_maintain ( IN syncuser_id INTEGER )
BEGIN
DECLARE pool_count INTEGER;
-- Determine how many ids to add to the pool
SELECT COUNT(*) INTO pool_count
FROM ULOrderIDPool
WHERE pool_emp_id = syncuser_id;
-- Top up the pool with new ids
WHILE pool_count < 20 LOOP
INSERT INTO ULOrderIDPool ( pool_emp_id )
VALUES ( syncuser_id );
SET pool_count = pool_count + 1;
END LOOP;
END
download_cursor
The download_cursor script for CustDB is as follows:
SELECT pool_order_id FROM ULOrderIDPool
WHERE last_modified >= {ml s.last_table_download}
AND pool_emp_id = {ml s.username}