page222
308
CREATE OR REPLACE TASK tsk_part_customer_order_europe
WAREHOUSE = tpc_wh_small
SCHEDULE = '1 minute'
WHEN system$stream_has_data ( 'strm_part_customer_order_europe' )
AS
CALL sp_load_customer( 'EUROPE' );
CREATE OR REPLACE TASK tsk_part_customer_order_africa
WAREHOUSE = tpc_wh_small
SCHEDULE = '1 minute'
WHEN system$stream_has_data ( 'strm_part_customer_order_africa' )
AS
CALL sp_load_customer( 'AFRICA' );
CREATE OR REPLACE TASK tsk_part_customer_order_america
WAREHOUSE = tpc_wh_small
SCHEDULE = '1 minute'
WHEN system$stream_has_data ( 'strm_part_customer_order_america' )
AS
CALL sp_load_customer( 'AMERICA' );
CREATE OR REPLACE TASK tsk_part_customer_order_middle_east
WAREHOUSE = tpc_wh_small
SCHEDULE = '1 minute'
WHEN system$stream_has_data ( 'strm_part_customer_order_middle_east' )
AS
CALL sp_load_customer( 'MIDDLE_EAST' );
Now enable each task.
ALTER TASK tsk_part_customer_order_asia RESUME;
ALTER TASK tsk_part_customer_order_europe RESUME;
ALTER TASK tsk_part_customer_order_africa RESUME;
ALTER TASK tsk_part_customer_order_america RESUME;
ALTER TASK tsk_part_customer_order_middle_east RESUME;
Prove all tasks are scheduled.
Chapter 8
parallelization