Add %age area column to vacancies section.
[capital-apms-progress.git] / rplctn / db2rptrg.p
blob044d1a1f0dfe5c546f53281bd4c286193ef44f5c
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 File : db2rptrg.p
6 Purpose : Create replication triggers table from the current database
7 schema.
9 Syntax : db2rptrg.p
11 Description :
13 Author(s) : Andreww McMillan
14 Created : 13/1/98
15 Notes :
16 ------------------------------------------------------------------------*/
18 {inc\ofc-this.i}
20 /* _UIB-CODE-BLOCK-END */
21 &ANALYZE-RESUME
24 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
26 /* ******************** Preprocessor Definitions ******************** */
28 &Scoped-define PROCEDURE-TYPE Procedure
32 /* _UIB-PREPROCESSOR-BLOCK-END */
33 &ANALYZE-RESUME
37 /* *********************** Procedure Settings ************************ */
39 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
40 /* Settings for THIS-PROCEDURE
41 Type: Procedure
42 Allow:
43 Frames: 0
44 Add Fields to: Neither
45 Other Settings: CODE-ONLY COMPILE
47 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
49 /* ************************* Create Window ************************** */
51 &ANALYZE-SUSPEND _CREATE-WINDOW
52 /* DESIGN Window definition (used by the UIB)
53 CREATE WINDOW Procedure ASSIGN
54 HEIGHT = .25
55 WIDTH = 32.86.
56 /* END WINDOW DEFINITION */
58 &ANALYZE-RESUME
63 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
66 /* *************************** Main Block *************************** */
67 DEF VAR trig-list AS CHAR NO-UNDO INITIAL "".
69 FOR EACH ReplTrigger: DELETE ReplTrigger. END.
71 FOR EACH _File WHERE NOT(_File._File-NAME BEGINS "_") NO-LOCK:
72 trig-list = (IF CAN-FIND( FIRST _File-trig OF _File WHERE _File-Trig._Event = "REPLICATION-CREATE") THEN "C" ELSE "")
73 + (IF CAN-FIND( FIRST _File-trig OF _File WHERE _File-Trig._Event = "REPLICATION-WRITE") THEN "M" ELSE "")
74 + (IF CAN-FIND( FIRST _File-trig OF _File WHERE _File-Trig._Event = "REPLICATION-DELETE") THEN "D" ELSE "").
75 RUN make-repl-trigger( _File._File-name, trig-list ).
77 END.
79 /* _UIB-CODE-BLOCK-END */
80 &ANALYZE-RESUME
83 /* ********************** Internal Procedures *********************** */
85 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE make-repl-trigger Procedure
86 PROCEDURE make-repl-trigger :
87 /*------------------------------------------------------------------------------
88 Purpose:
89 ------------------------------------------------------------------------------*/
90 DEF INPUT PARAMETER file-name AS CHAR NO-UNDO.
91 DEF INPUT PARAMETER event AS CHAR NO-UNDO.
93 FIND ReplTrigger WHERE ReplTrigger.TableToRepl = file-name EXCLUSIVE-LOCK NO-ERROR.
94 IF NOT AVAILABLE(ReplTrigger) THEN DO:
95 CREATE ReplTrigger.
96 ReplTrigger.TableToRepl = file-name.
97 ReplTrigger.Activity = "".
98 END.
99 ReplTrigger.Activity = ReplTrigger.Activity + event.
101 END PROCEDURE.
103 /* _UIB-CODE-BLOCK-END */
104 &ANALYZE-RESUME