The following articles mainly introduce the DB2 stored procedure. The following articles will introduce you to the relevant DB2 Stored Procedure knowledge. If you are curious about the DB2 Stored Procedure technology, the following articles will unveil its mysteries. Rule 20: The daily transaction amount of a merchant exceeds the daily average ratio of the previous week/month.
IN_TXN_DT: Transaction date, in the format of 'yyyy-MM-dd'
Delete stored procedure
- DROP PROCEDURE MI_PROJECT_RULE20;
Create a DB2 Stored Procedure
- CREATE PROCEDURE MI_PROJECT_RULE20
- (IN IN_TXN_DT DATE)
- LANGUAGE SQL
- BEGIN
- BEGIN
Clear transaction details for the current day to prevent repeated data
- DELETE FROM T05_DUBIOUS_TXN_SUM WHERE D_TXN_STAT_ID IN (SELECT D_TXN_STAT_ID FROM T05_DUBIOUS_TXN_STAT WHERE MI_ID=20 AND TXN_DT=IN_TXN_DT);
- COMMIT;
Clear summary data for the current day
- DELETE FROM T05_DUBIOUS_TXN_STAT WHERE MI_ID=20 AND TXN_DT=IN_TXN_DT;
- COMMIT;
Create a session temporary table
- DECLARE GLOBAL TEMPORARY TABLE T05_TMP_MI
- (
The above content is an introduction to some of the DB2 stored procedures. I hope you will get something better.