Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / one-off / try-to-fix-database-problem.p
blobd9405c63b2e10d421714093a166967f3ae526230
1 DEF VAR results AS CHAR NO-UNDO.
2 DEF VAR results2 AS CHAR NO-UNDO.
4 OUTPUT TO "CLIPBOARD".
5 &GLOB connect-it 1
6 /* &UNDEF connect-it */
9 &IF DEFINED(connect-it) = 1 &THEN
10 /* CONNECT TTPL -ld local-db -N TCP -S progress2 -H akld02. */
11 CONNECT D:\DATABASE\AUCKLAND\TTPL -ld local-db -1.
12 MESSAGE "Database local-db connected" VIEW-AS ALERT-BOX.
13 &ELSE
15 /* ON ASSIGN OF local-db._Field._field-rpos OVERRIDE DO: END. */
16 /* ON WRITE OF local-db._Field OVERRIDE DO: END. */
18 PUT UNFORMATTED "Database differences:" SKIP.
20 FOR EACH local-db._File NO-LOCK:
21 FIND ttpl._File NO-LOCK WHERE local-db._File._File-Name = ttpl._File._File-Name.
22 BUFFER-COMPARE ttpl._File TO local-db._File
23 SAVE RESULT IN results.
24 IF LOOKUP( "_CRC", results ) = 0 THEN NEXT.
25 PUT UNFORMATTED SKIP(1) STRING( local-db._File._File-Name, "X(30)") STRING(results, "X(78)") SKIP.
26 FOR EACH local-db._Field OF local-db._File:
27 FIND ttpl._Field OF ttpl._File NO-LOCK
28 WHERE local-db._Field._Field-Name = ttpl._Field._Field-Name.
29 BUFFER-COMPARE ttpl._Field TO local-db._Field
30 SAVE RESULT IN results2.
31 PUT UNFORMATTED " " STRING( local-db._Field._Field-Name, "X(27)") results2.
32 IF LOOKUP( "_field-rpos", results2 ) <> 0 THEN DO:
33 PUT UNFORMATTED " local-db rpos =" local-db._Field._field-rpos
34 " remote-db rpos=" ttpl._Field._field-rpos.
35 END.
36 PUT UNFORMATTED SKIP.
37 END.
38 END.
39 &ENDIF
41 OUTPUT CLOSE.