Die folgenden Skripten sind in der Tabelle ULCustomerIDPool definiert:
download_cursor
SELECT pool_cust_id FROM ULCustomerIDPool WHERE last_modified >= {ml s.last_table_download} AND pool_emp_id = {ml s.username} |
upload_insert Das upload_insert-Skript für CustDB sieht wie folgt aus:
INSERT INTO ULCustomerIDPool ( pool_cust_id ) VALUES( {ml r.pool_cust_id} ) |
upload_delete Das upload_delete-Skript für CustDB sieht wie folgt aus:
DELETE FROM ULCustomerIDPool WHERE pool_cust_id = {ml r.pool_cust_id} |
end_upload Das folgende end_upload-Skript stellt sicher, dass nach jedem Upload 20 Kunden-IDs im Kunden-ID-Pool bleiben:
CALL ULOrderIDPool_maintain( {ml s.username} ) |
Die UL_CustomerIDPool_maintain-Prozedur für CustDB sieht wie folgt aus:
CREATE PROCEDURE ULCustomerIDPool_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 ULCustomerIDPool WHERE pool_emp_id = syncuser_id; -- Top up the pool with new ids WHILE pool_count < 20 LOOP INSERT INTO ULCustomerIDPool ( pool_emp_id ) VALUES ( syncuser_id ); SET pool_count = pool_count + 1; END LOOP; END |
Kommentieren Sie diese Seite in DocCommentXchange. Senden Sie uns Feedback über diese Seite via E-Mail. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |